エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
[エラー] The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0 - Qiita
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
[エラー] The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0 - Qiita
from torchvision import transforms input_image = Image.open('test.png') #ここが問題 preprocess = ... from torchvision import transforms input_image = Image.open('test.png') #ここが問題 preprocess = transforms.Compose([ transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor(), transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), ]) input_tensor = preprocess(input_image)
2022/02/21 リンク