Please help some advice to fix the Error, I got the error when run test_model.py
command:
python3 tools/test_model.py --weights_path model/new_model/derain_gan_2018-11-02-19-55-27.ckpt-200000 --image_path data/test_data/test_1.png
and error is:
/home/tuencns/.local/lib/python3.5/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
VGG16 Network init complete
WARNING:tensorflow:From /home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From /home/tuencns/ws/raindrops2/attentive_gan_model/cnn_basenet.py:402: conv2d_transpose (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.conv2d_transpose instead.
2019-03-07 10:02:37.177862: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-03-07 10:02:37.198260: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3192000000 Hz
2019-03-07 10:02:37.198666: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x7022340 executing computations on platform Host. Devices:
2019-03-07 10:02:37.198690: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): ,
WARNING:tensorflow:From /home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
2019-03-07 10:02:37.420497: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Key derain_net_loss/attentive_autoencoder_loss/autoencoder_inference/gn_1/beta not found in checkpoint
Traceback (most recent call last):
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: Key derain_net_loss/attentive_autoencoder_loss/autoencoder_inference/gn_1/beta not found in checkpoint
[[{{node save/RestoreV2}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1276, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key derain_net_loss/attentive_autoencoder_loss/autoencoder_inference/gn_1/beta not found in checkpoint
[[node save/RestoreV2 (defined at tools/test_model.py:88) ]]
Caused by op 'save/RestoreV2', defined at:
File "tools/test_model.py", line 148, in
test_model(args.image_path, args.weights_path)
File "tools/test_model.py", line 88, in test_model
saver = tf.train.Saver()
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 832, in init
self.build()
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 844, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 881, in _build
build_save=build_save, build_restore=build_restore)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal
restore_sequentially, reshape)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 332, in _AddRestoreOps
restore_sequentially)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 580, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1572, in restore_v2
name=name)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()
NotFoundError (see above for traceback): Key derain_net_loss/attentive_autoencoder_loss/autoencoder_inference/gn_1/beta not found in checkpoint
[[node save/RestoreV2 (defined at tools/test_model.py:88) ]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1286, in restore
names_to_keys = object_graph_key_mapping(save_path)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1591, in object_graph_key_mapping
checkpointable.OBJECT_GRAPH_PROTO_KEY)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 370, in get_tensor
status)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: Key _CHECKPOINTABLE_OBJECT_GRAPH not found in checkpoint
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/test_model.py", line 148, in
test_model(args.image_path, args.weights_path)
File "tools/test_model.py", line 92, in test_model
saver.restore(sess=sess, save_path=weights_path)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1292, in restore
err, "a Variable name or other graph key that is missing")
tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Key derain_net_loss/attentive_autoencoder_loss/autoencoder_inference/gn_1/beta not found in checkpoint
[[node save/RestoreV2 (defined at tools/test_model.py:88) ]]
Caused by op 'save/RestoreV2', defined at:
File "tools/test_model.py", line 148, in
test_model(args.image_path, args.weights_path)
File "tools/test_model.py", line 88, in test_model
saver = tf.train.Saver()
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 832, in init
self.build()
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 844, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 881, in _build
build_save=build_save, build_restore=build_restore)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 513, in _build_internal
restore_sequentially, reshape)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 332, in _AddRestoreOps
restore_sequentially)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 580, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1572, in restore_v2
name=name)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/home/tuencns/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()
NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Key derain_net_loss/attentive_autoencoder_loss/autoencoder_inference/gn_1/beta not found in checkpoint
[[node save/RestoreV2 (defined at tools/test_model.py:88) ]]
Thanks,