cvlab-epfl/tf-lift

Troubles with running test_kp*.sh

Raverstern opened this issue · 4 comments

Hi there.

I got the following error when I ran either test_kp.sh or test_kp_legacy.sh:

 File "/tf-lift/tester.py", line 88, in __init__
   self.saver[_key] = tf.train.Saver(self.network.allparams[_key])
ValueError: At least two variables have the same name: network/lift/kp/conv-ghh-1/biases

All code were intact, and no pre-trained model was added. Is it a bug of the code?

refer to this issue #16
install tensorflow-gpu==1.4.0

Excuse me, but I don't think this is caused by Tensorflow. I ran the code line by line, and found that line 483 and 492 in networks/lift.py:

            self._build_module(
                module="kp",
                inputs=self.outputs["resize"],
                bypass=xyz_gt_scaled,
                names=["P1", "P2", "P3", "P4"],
                skip=subtask == "ori" or subtask == "desc",
            )

            # For image based test
            self._build_module(
                module="kp",
                inputs=self.inputs["img"],
                bypass=self.inputs["img"],  # This is a dummy
                names=["img"],
                skip=subtask != "kp",
                reuse=True,
                test_only=True,
            )

when module="kp", these two function calls will add two ghh layers to the network, so causes the problem. But I just don't know how to fix it...

kmyi commented

They should reuse the parameters, and they successfully do in the other tensorflow version. For now, you can use that workaround.

Please fix this bug. I have a cuda version that is incompatible with tensorflow==1.4.0