yinguobing / cnn-facial-landmark

Training code for facial landmark detection based on deep convolutional neural network.
MIT License
623 stars 183 forks source link

tensorflow.python.framework.errors_impl.NotFoundError: train.record #62

Closed ccoa closed 4 years ago

ccoa commented 5 years ago

When I execute:

python3 landmark.py \ --train_record train.record \ --val_record validation.record \ --model_dir train \ --export_dir saved_model \ --train_steps 500 \ --batch_size 32

I'm getting the following error:

WARNING: Logging before flag parsing goes to stderr. W0722 10:52:55.298707 140450359764800 deprecation_wrapper.py:119] From landmark.py:193: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

W0722 10:52:55.298938 140450359764800 deprecation_wrapper.py:119] From landmark.py:193: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.

W0722 10:52:55.299041 140450359764800 deprecation_wrapper.py:119] From landmark.py:194: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

I0722 10:52:55.299881 140450359764800 estimator.py:1790] Using default config. I0722 10:52:55.300411 140450359764800 estimator.py:209] Using config: {'_model_dir': 'train', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': allow_soft_placement: true graph_options { rewrite_options { meta_optimizer_iterations: ONE } } , '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fbcfdfe9e10>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1} W0722 10:52:55.300956 140450359764800 deprecation_wrapper.py:119] From landmark.py:170: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead.

I0722 10:52:55.301030 140450359764800 landmark.py:170] Starting to train. W0722 10:52:55.318467 140450359764800 deprecation.py:323] From /home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/training_util.py:236: Variable.initialized_value (from tensorflow.python.ops.variables) is deprecated and will be removed in a future version. Instructions for updating: Use Variable.read_value. Variables in 2.X are initialized automatically both in eager and graph (inside tf.defun) contexts. W0722 10:52:55.347386 140450359764800 deprecation_wrapper.py:119] From landmark.py:101: The name tf.FixedLenFeature is deprecated. Please use tf.io.FixedLenFeature instead.

W0722 10:52:55.347611 140450359764800 deprecation_wrapper.py:119] From landmark.py:105: The name tf.parse_single_example is deprecated. Please use tf.io.parse_single_example instead.

W0722 10:52:55.417925 140450359764800 deprecation.py:323] From landmark.py:131: DatasetV1.make_one_shot_iterator (from tensorflow.python.data.ops.dataset_ops) is deprecated and will be removed in a future version. Instructions for updating: Use for ... in dataset: to iterate over a dataset. If using tf.estimator, return the Dataset object directly from your input function. As a last resort, you can use tf.compat.v1.data.make_one_shot_iterator(dataset). I0722 10:52:55.432821 140450359764800 estimator.py:1145] Calling model_fn. W0722 10:52:55.433665 140450359764800 deprecation.py:323] From /home/omar/Documents/cnn-facial-landmark/model.py:25: conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version. Instructions for updating: Use tf.keras.layers.Conv2D instead. W0722 10:52:55.435666 140450359764800 deprecation.py:506] From /home/omar/.local/lib/python3.6/site-packages/tensorflow/python/ops/init_ops.py:1251: calling VarianceScaling.init (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version. Instructions for updating: Call initializer instance with the dtype argument instead of passing it to the constructor W0722 10:52:55.615834 140450359764800 deprecation.py:323] From /home/omar/Documents/cnn-facial-landmark/model.py:33: max_pooling2d (from tensorflow.python.layers.pooling) is deprecated and will be removed in a future version. Instructions for updating: Use keras.layers.MaxPooling2D instead. W0722 10:52:55.831045 140450359764800 deprecation.py:323] From /home/omar/Documents/cnn-facial-landmark/model.py:139: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version. Instructions for updating: Use keras.layers.flatten instead. W0722 10:52:56.011964 140450359764800 deprecation.py:323] From /home/omar/Documents/cnn-facial-landmark/model.py:146: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version. Instructions for updating: Use keras.layers.dense instead. W0722 10:52:56.259871 140450359764800 deprecation_wrapper.py:119] From landmark.py:57: The name tf.losses.mean_squared_error is deprecated. Please use tf.compat.v1.losses.mean_squared_error instead.

W0722 10:52:56.269139 140450359764800 deprecation.py:323] From /home/omar/.local/lib/python3.6/site-packages/tensorflow/python/ops/losses/losses_impl.py:121: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where W0722 10:52:56.279297 140450359764800 deprecation_wrapper.py:119] From landmark.py:61: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.

W0722 10:52:56.280684 140450359764800 deprecation_wrapper.py:119] From landmark.py:65: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.

W0722 10:52:56.280875 140450359764800 deprecation_wrapper.py:119] From landmark.py:69: The name tf.train.get_global_step is deprecated. Please use tf.compat.v1.train.get_global_step instead.

W0722 10:52:56.651013 140450359764800 deprecation_wrapper.py:119] From landmark.py:74: The name tf.metrics.root_mean_squared_error is deprecated. Please use tf.compat.v1.metrics.root_mean_squared_error instead.

W0722 10:52:56.668530 140450359764800 deprecation_wrapper.py:119] From landmark.py:84: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.

I0722 10:52:56.670208 140450359764800 estimator.py:1147] Done calling model_fn. I0722 10:52:56.671649 140450359764800 basic_session_run_hooks.py:541] Create CheckpointSaverHook. I0722 10:52:56.938906 140450359764800 monitored_session.py:240] Graph was finalized. 2019-07-22 10:52:56.939267: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-07-22 10:52:56.959803: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2400000000 Hz 2019-07-22 10:52:56.960073: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x309d5a0 executing computations on platform Host. Devices: 2019-07-22 10:52:56.960109: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): , W0722 10:52:56.961538 140450359764800 deprecation.py:323] From /home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1276: 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. I0722 10:52:56.962500 140450359764800 saver.py:1280] Restoring parameters from train/model.ckpt-0 2019-07-22 10:52:57.047993: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile. W0722 10:52:57.108107 140450359764800 deprecation.py:323] From /home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1066: get_checkpoint_mtimes (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file utilities to get mtimes. I0722 10:52:57.179555 140450359764800 session_manager.py:500] Running local_init_op. I0722 10:52:57.199104 140450359764800 session_manager.py:502] Done running local_init_op. I0722 10:52:57.654136 140450359764800 basic_session_run_hooks.py:606] Saving checkpoints for 0 into train/model.ckpt. Traceback (most recent call last): File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call return fn(*args) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.NotFoundError: train.record; No such file or directory [[{{node IteratorGetNext}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "landmark.py", line 194, in tf.app.run(main) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/omar/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run _run_main(main, args) File "/home/omar/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "landmark.py", line 176, in main steps=args.train_steps) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _train_model_default saving_listeners) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _train_with_estimatorspec , loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss]) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 754, in run run_metadata=run_metadata) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1252, in run run_metadata=run_metadata) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1353, in run raise six.reraise(original_exc_info) File "/home/omar/.local/lib/python3.6/site-packages/six.py", line 693, in reraise raise value File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1338, in run return self._sess.run(args, *kwargs) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1411, in run run_metadata=run_metadata) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1169, in run return self._sess.run(args, **kwargs) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run run_metadata_ptr) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run feed_dict_tensor, options, run_metadata) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run run_metadata) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: train.record; No such file or directory [[node IteratorGetNext (defined at landmark.py:134) ]]

Errors may have originated from an input operation. Input Source operations connected to node IteratorGetNext: OneShotIterator (defined at landmark.py:131)

Original stack trace for 'IteratorGetNext': File "landmark.py", line 194, in tf.app.run(main) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/omar/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run _run_main(main, args) File "/home/omar/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "landmark.py", line 176, in main steps=args.train_steps) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1185, in _train_model_default input_fn, ModeKeys.TRAIN)) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1022, in _get_features_and_labels_from_input_fn self._call_input_fn(input_fn, mode)) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1113, in _call_input_fn return input_fn(*kwargs) File "landmark.py", line 175, in shuffle=True), File "landmark.py", line 134, in input_fn image, label = iterator.get_next() File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 426, in get_next output_shapes=self._structure._flat_shapes, name=name) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 1947, in iterator_get_next output_shapes=output_shapes, name=name) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(args, **kwargs) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op op_def=op_def) File "/home/omar/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2005, in init self._traceback = tf_stack.extract_stack()

yinguobing commented 5 years ago

Check the file path of the training record file.

ccoa commented 5 years ago

Can you give me some link where I can download necesary files for this project (train.record, validation.record, etc)?

yinguobing commented 5 years ago

No. I do not own these data and can not distribute them here. You have to create record files yourself. But it shouldn't be hard as all data samples are public.

ccoa commented 4 years ago

Actually I was referring to some free models that I can use to be able to execute your code without errors. If you can't help me there is no problem. Thank you anyway.