問題タブ [onnx]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python-3.x - Pytourch 3.0 モデルの予期しないキー「module.features.0.weight」を state_dict にロードする際の問題
Pytorch を使用してトレーニングしたモデルを読み込もうとしていますが、次のエラーが発生し続けます。
ファイル「convert.py」、12 行目、model.load_state_dict(torch.load('model/model_vgg2d_2.pth')) 内 ファイル「/usr/local/lib/python3.5/dist-packages/torch/nn/modules」 /module.py"、490 行目、load_state_dict .format(name)) KeyError: 'state_dict の予期しないキー「module.features.0.weight」'
以下は私のコードです:
モデルのトレーニングに使用したのと同じマシン (複数の GPU を搭載) で作業しています。私が間違っていることは何ですか?