StacyYang / MXNet-Gluon-Style-Transfer

Neural Style and MSG-Net
http://computervisionrutgers.github.io/MSG-Net/
MIT License
148 stars 32 forks source link

Error when load params #5

Closed freshcoderman closed 6 years ago

freshcoderman commented 6 years ago

Hi, I tried the following command as you provide:

python main.py eval --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg --model models/21styles.params --content-size 1024

but got the following error:

Traceback (most recent call last): File "main.py", line 214, in main() File "main.py", line 203, in main evaluate(args) File "main.py", line 129, in evaluate style_model.load_params(args.model, ctx=ctx) File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/block.py", line 317, in load_params self.prefix) File "/usr/local/lib/python2.7/dist-packages/mxnet/gluon/parameter.py", line 669, in load "Parameter %s is missing in file %s"%(name[lprefix:], filename) AssertionError: Parameter conv0_weight is missing in file models/21styles.params

I have checked the names of params in 21styles.params, they are something like model.2.conv_block.2.weight, model.4.conv_block.2.bias and so on. It seems that the net and the params are not matching. Can you check that? Thank you

zhanghang1989 commented 6 years ago

I think your mxnet version is too old. Please use 1.2 or later

zhanghang1989 commented 6 years ago

Please run python models/download_model.py to download the model

freshcoderman commented 6 years ago

@zhanghang1989 you are right. Solved by updating mxnet to 1.3. Thank you.

ALLUPRASAD commented 4 years ago

did this issue solved?