cvlab-epfl / tf-lift

Tensorflow port of LIFT (ECCV 2016), with training code.
197 stars 55 forks source link

Troubles with running test_kp*.sh #17

Closed Raverstern closed 5 years ago

Raverstern commented 6 years ago

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?

nrupatunga commented 6 years ago

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

Raverstern commented 6 years ago

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 6 years ago

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

half-potato commented 4 years ago

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