tomrunia / TF_FeatureExtraction

Convenient wrapper for TensorFlow feature extraction from pre-trained models using tf.contrib.slim
180 stars 61 forks source link

Error while running the code the second time #15

Open NainaSaid opened 5 years ago

NainaSaid commented 5 years ago

Dear all

I first successfully ran the code and saved the extracted features to .H5 file. But now when i am trying to run it again, i am the getting the following error

Variable resnet_v1_101/conv1/weights already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:

File "c:\users\nainasaid\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\framework\ops.py", line 1719, in init self._traceback = tf_stack.extract_stack() File "c:\users\nainasaid\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\framework\ops.py", line 3158, in create_op op_def=op_def) File "c:\users\nainasaid\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func return func(*args, **kwargs)

Can someone please tell me how to fix this issue?

AzizCode92 commented 5 years ago

Maybe use tf.reset_default_graph() ?