Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run train.py : At least two variables have the same name #35

Open
BoomFan opened this issue Aug 3, 2018 · 3 comments
Open

run train.py : At least two variables have the same name #35

BoomFan opened this issue Aug 3, 2018 · 3 comments

Comments

@BoomFan
Copy link

BoomFan commented Aug 3, 2018

Thanks for your work.

I managed to ./make.sh and then run data.py

When I try to run train.py file for KITTI dataset, errors like this shows up:

Use fusion-feature-2fc
Traceback (most recent call last):
  File "train.py", line 275, in <module>
    fast_test_mode=True if max_iter == 1 else False)
  File "/home/boom/MV3D/src/MV3D/src/mv3d.py", line 492, in __init__
    MV3D.__init__(self, top_shape, front_shape, rgb_shape, log_tag=log_tag)
  File "/home/boom/MV3D/src/MV3D/src/mv3d.py", line 156, in __init__
    checkpoint_dir=self.ckpt_dir)
  File "/home/boom/MV3D/src/MV3D/src/mv3d.py", line 86, in __init__
    self.saver=  tf.train.Saver(self.variables)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1338, in __init__
    self.build()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1347, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 1384, in _build
    build_save=build_save, build_restore=build_restore)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 813, in _build_internal
    saveables = self._ValidateAndSliceInputs(names_to_saveables)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 661, in _ValidateAndSliceInputs
    names_to_saveables = BaseSaverBuilder.OpListToDict(names_to_saveables)
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/saver.py", line 638, in OpListToDict
    name)
ValueError: At least two variables have the same name: MV3D/top_view_rpn/feature-extract-resnet/MV3D/top_view_rpn/feature-extract-resnet/batch_normalization_1/moving_mean/biased

Could anyone offer me a help, please? I'm using Tensorflow 1.8.0 by the way. Is it because of the new version of Tensorflow?

@YizhouFan
Copy link

Same problem here... Still working to solve it.

@hz-fengpeng
Copy link

hz-fengpeng commented Mar 5, 2019

Do you fix the problem, I meet the same problem.
I find where is the problem.
In the src/mv3d.py file, the Net.get_variables() function is wrong.
def get_variables(self, scope_names): variables=[] for scope in scope_names: variables = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope=scope) assert len(variables) != 0 variables += variables return variables
the right code is
variable = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope=scope) assert len(variable) != 0 variables += variable
pay attention to variables and variable!!!

@DonghoonPark12
Copy link

@hz-fengpeng Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants