uzh-rpg / netvlad_tf_open

Tensorflow port of https://github.com/Relja/netvlad
MIT License
244 stars 65 forks source link

the problem in M2 about Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? #12

Open yuqiulajiao opened 1 year ago

yuqiulajiao commented 1 year ago

My computer is macbook M2,i alredy extract the zip and move its contents to the checkpoints folder of the repo, when i run default network code,the have bug in those: 2022-11-22 20:42:45.803163: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? 2022-11-22 20:42:45.803195: W tensorflow/core/util/tensor_slice_reader.cc:96] Could not open /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? 2022-11-22 20:42:45.803207: W tensorflow/core/framework/op_kernel.cc:1745] OP_REQUIRES failed at save_restore_tensor.cc:188 : DATA_LOSS: Unable to open table file /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? Traceback (most recent call last): File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1377, in _do_call return fn(*args) File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1360, in _run_fn return self._call_tf_sessionrun(options, feed_dict, fetch_list, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1453, in _call_tf_sessionrun return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict, tensorflow.python.framework.errors_impl.DataLossError: 2 root error(s) found. (0) DATA_LOSS: Unable to open table file /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? [[{{node save/RestoreV2}}]] [[GroupCrossDeviceControlEdges_0/save/restore_all/_2]] (1) DATA_LOSS: Unable to open table file /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? [[{{node save/RestoreV2}}]] 0 successful operations. 0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/yuqiula/Downloads/netvlad_tf_open-master/python/netvlad_tf/test.py", line 17, in saver.restore(sess, nets.defaultCheckpoint()) File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 1417, in restore sess.run(self.saver_def.restore_op_name, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 967, in run result = self._run(None, fetches, feed_dict, options_ptr, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1190, in _run results = self._do_run(handle, final_targets, final_fetches, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1370, in _do_run return self._do_call(_run_fn, feeds, fetches, targets, options, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/client/session.py", line 1396, in _do_call raise type(e)(node_def, op, message) # pylint: disable=no-value-for-parameter tensorflow.python.framework.errors_impl.DataLossError: Graph execution error:

Detected at node 'save/RestoreV2' defined at (most recent call last): File "/Users/yuqiula/Downloads/netvlad_tf_open-master/python/netvlad_tf/test.py", line 14, in saver = tf.train.Saver() Node: 'save/RestoreV2' Detected at node 'save/RestoreV2' defined at (most recent call last): File "/Users/yuqiula/Downloads/netvlad_tf_open-master/python/netvlad_tf/test.py", line 14, in saver = tf.train.Saver() Node: 'save/RestoreV2' 2 root error(s) found. (0) DATA_LOSS: Unable to open table file /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? [[{{node save/RestoreV2}}]] [[GroupCrossDeviceControlEdges_0/save/restore_all/_2]] (1) DATA_LOSS: Unable to open table file /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white: FAILED_PRECONDITION: /Users/yuqiula/Downloads/netvlad_tf_open-master/checkpoints/vd16_pitts30k_conv5_3_vlad_preL2_intra_white; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator? [[{{node save/RestoreV2}}]] 0 successful operations. 0 derived errors ignored.

Original stack trace for 'save/RestoreV2': File "/Users/yuqiula/Downloads/netvlad_tf_open-master/python/netvlad_tf/test.py", line 14, in saver = tf.train.Saver() File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 933, in init self.build() File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 945, in build self._build(self._filename, build_save=True, build_restore=True) File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 973, in _build self.saver_def = self._builder._build_internal( # pylint: disable=protected-access File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 543, in _build_internal restore_op = self._AddRestoreOps(filename_tensor, saveables, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 363, in _AddRestoreOps all_tensors = self.bulk_restore(filename_tensor, saveables, preferred_shard, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 611, in bulk_restore return io_ops.restore_v2(filename_tensor, names, slices, dtypes) File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1501, in restorev2 , _, _op, _outputs = _op_def_library._apply_op_helper( File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/op_def_library.py", line 797, in _apply_op_helper op = g._create_op_internal(op_type_name, inputs, dtypes=None, File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 3754, in _create_op_internal ret = Operation( File "/Users/yuqiula/miniforge3/lib/python3.9/site-packages/tensorflow/python/framework/ops.py", line 2133, in init self._traceback = tf_stack.extract_stack_for_node(self._c_op)