cvlab-epfl / tf-lift

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

How to test the pretrained model directly? #27

Closed chuanzhidong closed 5 years ago

chuanzhidong commented 5 years ago

I downloaded the "release-no-aug" folder and there were three subfolders: "desc", "kp" and "ori". I created a new folder under tf-lift folder, named "logs". Under "logs" folder I created a subfolder named "test". I copyed the three folders "desc", "kp" and "ori" in to the "tf-lift/logs/test/".

I put the test image named "image1.jpg" in "tf-lift/" and run the command in tf-lift: python main.py --task=test --subtask=kp --logdir=logs/test --test_img_file=image1.jpg --test_out_file=image1_kp.txt

It gives me an error: /home/czdong/anaconda3/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters User and hostname: czdong@czdong 2018-11-05 13:50:07.407175: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-11-05 13:50:07.529312: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:897] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2018-11-05 13:50:07.529890: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties: name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7715 pciBusID: 0000:08:00.0 totalMemory: 7.93GiB freeMemory: 7.30GiB 2018-11-05 13:50:07.529910: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0 2018-11-05 13:50:07.708551: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix: 2018-11-05 13:50:07.708587: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0 2018-11-05 13:50:07.708592: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0: N 2018-11-05 13:50:07.708786: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7043 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:08:00.0, compute capability: 6.1) [kp] Loaded input normalizers for testing WARNING:tensorflow:From /home/czdong/Desktop/tf-lift/layers.py:353: calling reduce_max (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead WARNING:tensorflow:From /home/czdong/Desktop/tf-lift/layers.py:368: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead

Variables: name (type shape) [size]

network/lift/kp/conv-ghh-1/weights:0 (float32_ref 25x25x1x16) [10000, bytes: 40000] network/lift/kp/conv-ghh-1/biases:0 (float32_ref 16) [16, bytes: 64] network/lift/desc/conv-act-pool-norm-1/weights:0 (float32_ref 7x7x1x32) [1568, bytes: 6272] network/lift/desc/conv-act-pool-norm-1/biases:0 (float32_ref 32) [32, bytes: 128] network/lift/desc/conv-act-pool-norm-2/weights:0 (float32_ref 6x6x32x64) [73728, bytes: 294912] network/lift/desc/conv-act-pool-norm-2/biases:0 (float32_ref 64) [64, bytes: 256] network/lift/desc/conv-act-pool-3/weights:0 (float32_ref 5x5x64x128) [204800, bytes: 819200] network/lift/desc/conv-act-pool-3/biases:0 (float32_ref 128) [128, bytes: 512] Total size of variables: 290336 Total bytes of variables: 1161344 Traceback (most recent call last): File "main.py", line 98, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "main.py", line 67, in main task = Tester(config, rng) File "/home/czdong/Desktop/tf-lift/tester.py", line 88, in init self.saver[_key] = tf.train.Saver(self.network.allparams[_key]) File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1281, in init self.build() File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1293, in build self._build(self._filename, build_save=True, build_restore=True) File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1330, in _build build_save=build_save, build_restore=build_restore) File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 756, in _build_internal saveables = self._ValidateAndSliceInputs(names_to_saveables) File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 656, in _ValidateAndSliceInputs names_to_saveables = BaseSaverBuilder.OpListToDict(names_to_saveables) File "/home/czdong/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 563, in OpListToDict name) ValueError: At least two variables have the same name: network/lift/kp/conv-ghh-1/biases

my cuda is nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA Corporation Built on Fri_Sep__1_21:08:03_CDT_2017 Cuda compilation tools, release 9.0, V9.0.176

python3.6 opencv3.4.3

Is there anyone know how to solve this problem? Thank you very much.

kmyi commented 5 years ago

This seems to be Tensorflow version issue. Please see other closed issues...

Shu-HowTing commented 5 years ago

Sir,I have met the same bug with you !Have you solve it?If do,can you tell me how to fix it ?Thank you!

kmyi commented 5 years ago

Please downgrade to TF 1.4, and please do not necro threads