facebookarchive / models

A repository for storing pre-trained Caffe2 models.
Apache License 2.0
430 stars 127 forks source link

module 'caffe2.python.models.squeezenet' has no attribute 'init_net' #30

Open miaoshuyu opened 6 years ago

miaoshuyu commented 6 years ago

After I download init_net.pb and predict_net.pb of squeezenet and put them into "C:\Program Files\Caffe2\caffe2\python\models\squeezenet". when I run the code as follow: tim 20180318221706

There is an error as pictures.The problem has confused me so long time! How can I solve it.Thank you very much.

orionr commented 6 years ago

Hi @miaoshuyu. When you download that model with the model downloader it should symlink https://github.com/pytorch/pytorch/blob/master/caffe2/python/models/__sym_init__.py to the __init__.py in that directory. This is what allows you to load the model automatically. Can you confirm this file is at C:\Program Files\Caffe2\caffe2\python\models\__init__.py? It's possible this doesn't work on Windows in which case we need to fix it.