質問: ### 前提・実現したいこと あるサイトのページ(URL:https://touch-sp.hatenablog.com/entry/2018/10/20/215105)を参考にしてWindowsでCycleGANを実装しようとしました。 しかし、公開データセットで実装まではできたのですが、実行の際に 下記のエラーが出てしまい、実行できませんでした。 ご教授お願いいたします。 ### 発生している問題・エラーメッセージ ``` RuntimeError: Error(s) in loading state_dict for ResnetGenerator: Missing key(s) in state_dict: "model.10.conv_block.6.weight", "model.10.conv_block.6.bias", "model.11.conv_block.6.weight", "model.11.conv_block.6.bias", "model.12.conv_block.6.weight", "model.12.conv_block.6.bias", "model.13.conv_block.6.weight", "model.13.conv_block.6.bias", "model.14.conv_block.6.weight", "model.14.conv_block.6.bias", "model.15.conv_block.6.weight", "model.15.conv_block.6.bias", "model.16.conv_block.6.weight", "model.16.conv_block.6.bias", "model.17.conv_block.6.weight", "model.17.conv_block.6.bias", "model.18.conv_block.6.weight", "model.18.conv_block.6.bias". Unexpected key(s) in state_dict: "model.10.conv_block.5.weight", "model.10.conv_block.5.bias", "model.10.conv_block.6.running_mean", "model.10.conv_block.6.running_var", "model.10.conv_block.6.num_batches_tracked", "model.11.conv_block.5.weight", "model.11.conv_block.5.bias", "model.11.conv_block.6.running_mean", "model.11.conv_block.6.running_var", "model.11.conv_block.6.num_batches_tracked", "model.12.conv_block.5.weight", "model.12.conv_block.5.bias", "model.12.conv_block.6.running_mean", "model.12.conv_block.6.running_var", "model.12.conv_block.6.num_batches_tracked", "model.13.conv_block.5.weight", "model.13.conv_block.5.bias", "model.13.conv_block.6.running_mean", "model.13.conv_block.6.running_var", "model.13.conv_block.6.num_batches_tracked", "model.14.conv_block.5.weight", "model.14.conv_block.5.bias", "model.14.conv_block.6.running_mean", "model.14.conv_block.6.running_var", "model.14.conv_block.6.num_batches_tracked", "model.15.conv_block.5.weight", "model.15.conv_block.5.bias", "model.15.conv_block.6.running_mean", "model.15.conv_block.6.running_var", "model.15.conv_block.6.num_batches_tracked", "model.16.conv_block.5.weight", "model.16.conv_block.5.bias", "model.16.conv_block.6.running_mean", "model.16.conv_block.6.running_var", "model.16.conv_block.6.num_batches_tracked", "model.17.conv_block.5.weight", "model.17.conv_block.5.bias", "model.17.conv_block.6.running_mean", "model.17.conv_block.6.running_var", "model.17.conv_block.6.num_batches_tracked", "model.18.conv_block.5.weight", "model.18.conv_block.5.bias", "model.18.conv_block.6.running_mean", "model.18.conv_block.6.running_var", "model.18.conv_block.6.num_batches_tracked". ``` ### 該当のソースコード ``` python test.py --dataroot horse2zebra/testA --name horse2zebra_pretrained --model test ``` ### 試したこと 他のサイト複数を見て試してみましたが、同様のエラーが発生しました。 ### 補足情報(FW/ツールのバージョンなど) Pythonのバージョンは3.8.2 Windows10 Pro 64bit NVIDIA GeForce GTX1080 CUDA9.2 cudnn7.6.5 Python3.6.6 です。
回答: --no_dropout を付けたら、直るようです Error(s) in loading state_dict for ResnetGenerator: #461