tf-faster-rcnn icon indicating copy to clipboard operation
tf-faster-rcnn copied to clipboard

ImportError: cannot import name resnet_v1

Open backtime92 opened this issue 7 years ago • 8 comments

hi,Is there anyone have this problem?

Traceback (most recent call last): File "./tools/test_net.py", line 20, in from nets.resnet_v1 import resnetv1 File "/home/amax/Documents/test/tf-faster-rcnn/tools/../lib/nets/resnet_v1.py", line 15, in from tensorflow.contrib.slim.python.slim.nets import resnet_v1 File "/home/amax/anaconda3/envs/yanhai/lib/python2.7/site-packages/tensorflow/contrib/slim/python/slim/nets/resnet_v1.py", line 60, in from tensorflow.contrib.slim.nets import resnet_utils File "/home/amax/anaconda3/envs/yanhai/lib/python2.7/site-packages/tensorflow/contrib/slim/nets.py", line 40, in from tensorflow.contrib.slim.python.slim.nets import resnet_v1

backtime92 avatar Oct 05 '17 04:10 backtime92

is your tf version 1.2+?

endernewton avatar Oct 05 '17 15:10 endernewton

my tf version is 0.12.1 it reports that "ImportError: cannot import name resnet_v1 from tensorflow.contrib.slim.python.slim.nets" when I load test_faster_rcnn.sh i add a new PYTHONPATH environment variable where there is resnet_v1.py, but it still failed. thx

hongrui16 avatar Nov 06 '17 08:11 hongrui16

I also have this problem and my tf_version is 1.1 with GPU. Is there anyone can solve this problem? thx.

VisintZJ avatar Nov 10 '17 11:11 VisintZJ

tf_version 1.2 can solve the error

backtime92 avatar Nov 12 '17 04:11 backtime92

+1 I have the same issue.. tf_1.2 did not work out

ATPNazlit avatar Nov 16 '17 16:11 ATPNazlit

i think maybe you can reinstall tf with version 1.2+,i solve this problem with the approach

backtime92 avatar Nov 17 '17 01:11 backtime92

i find a solution under tf_0.12.1 do a little change

tf-faster-rcnn/lib/nets/resnet_v1.py LINE 15

#from tensorflow.contrib.slim.python.slim.nets import resnet_v1 import resnet_v1

it works

hongrui16 avatar Nov 17 '17 06:11 hongrui16

https://stackoverflow.com/questions/40957286/attributeerror-module-tensorflow-contrib-slim-has-no-attribute-nets This works for me on tensorflow version 1.15.

krsandeep98 avatar Feb 19 '20 18:02 krsandeep98