python pythonerror The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()の解決方法 numpyを使用時にこのエラーが出現しました。 エラーに書いてある通り、多くの場合は、numpy.any()かnumpy.all()を使うことで解決します。 a=numpy.zeros(10) b=numpy.zeros(10) if a==b: print("true") 例えば、上記のコードで... よる
python pythonerror 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensorの解決方法 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensorの解決方法... よる
python pythonerror 'builtin_function_or_method' object has no attribute'view'の解決方法 'builtin_function_or_method' object has no attribute'view'の解決方法... よる
python pythonerror view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(…) instead.の解決方法 view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(…) instead.の解決方法... よる
python 【Python】セルの文頭に[%%capture]や[%time]などを書く意味と役割(セルマジックコマンド) おそらく文頭の%%や%のフレーズは、google colabかjupyter notebookで見つけたのではないでしょうか。google colabはjupyter notebookを基に作られており、セルマジックコマンドという命令軍が存在します。例えば、%%captureはその中の一つで、セルの結果をdisplay... よる
未分類 Microsoft EdgeGoogle Chromeヘルプ大量に開く 【勝手に開く】Microsoft Edgeのヘルプと学習/Google Chrome ヘルプで大量のタブが勝手に開くときの対処方法 F1キーが押されるとヘルプが表示されるので、F1キーが押されたと誤認していました。デスクトップの場合、キーボードを別のに変えるかスクリーンキーボード... よる
C言語 【c言語】if文の条件式で使われる関数まとめ string.h strcmp (const char *s1, const char *s2 ) s1,s2文字列が同じかどうかを比較する関数。ヌル文字が出現した時点で比較は終了。 char s1="abc\0def"; char s2="abc\0hij"; if(strcmp(s1,s2) == 0){ prin... よる
C言語 【c言語】if文の基本的な書き方まとめ 基本的な記述方法まとめ 条件分岐処理if文の基本的な記述方法は以下の通りです。 if(n>0){ printf("nは0より大きい"); }else if(n==0){ printf("nは0です"); }else{ printf("nは0より小さい"); } if(n==0)の箇所は、if(n=0)と書いてしまうとn... よる
python pythonでモザイク画像処理をしてみる Pythonでモザイク画像処理をする方法を簡単に紹介します。Pythonのインストール後、新しく作成した作業を行うフォルダ内でコマンドプロンプトを... よる