我正在尝试从source运行此地标。py,这给了我以下输出:
Traceback (most recent call last):
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 1356, in _do_call
return fn(*args)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.UnknownError: NewRandomAccessFile failed to Create/Open: Dataset/AFLW : Access is denied.
; Input/output error
[[{{node IteratorGetNext}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py", line 221, in <module>
tf.app.run(main) #runs def main (first)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 299, in run
_run_main(main, args)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 250, in _run_main
sys.exit(main(argv))
File "C:/Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py", line 202, in main
steps=args.train_steps) #goes to def input_fn (second)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 367, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1158, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1192, in _train_model_default
saving_listeners)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1484, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\training\monitored_session.py", line 754, in run
run_metadata=run_metadata)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\training\monitored_session.py", line 1252, in run
run_metadata=run_metadata)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\training\monitored_session.py", line 1353, in run
raise six.reraise(*original_exc_info)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\training\monitored_session.py", line 1338, in run
return self._sess.run(*args, **kwargs)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\training\monitored_session.py", line 1411, in run
run_metadata=run_metadata)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\training\monitored_session.py", line 1169, in run
return self._sess.run(*args, **kwargs)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 950, in run
run_metadata_ptr)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 1350, in _do_run
run_metadata)
File "C:\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\client\session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnknownError: NewRandomAccessFile failed to Create/Open: Dataset/AFLW : Access is denied.
; Input/output error
[[node IteratorGetNext (defined at /Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py:140) ]]
Errors may have originated from an input operation.
Input Source operations connected to node IteratorGetNext:
OneShotIterator (defined at /Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py:134)
Original stack trace for 'IteratorGetNext':
File "/Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py", line 221, in <module>
tf.app.run(main) #runs def main (first)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 299, in run
_run_main(main, args)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 250, in _run_main
sys.exit(main(argv))
File "/Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py", line 202, in main
steps=args.train_steps) #goes to def input_fn (second)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 367, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1158, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1185, in _train_model_default
input_fn, ModeKeys.TRAIN))
File "\Users\jsohw\AppData\Roaming\Python\Python37\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 "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1113, in _call_input_fn
return input_fn(**kwargs)
File "/Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py", line 201, in <lambda>
shuffle=True),
File "/Users/jsohw/PycharmProjects/cnn-facial-landmark-master/landmark.py", line 140, in input_fn
image, label = iterator.get_next()
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\data\ops\iterator_ops.py", line 426, in get_next
output_shapes=self._structure._flat_shapes, name=name)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\ops\gen_dataset_ops.py", line 1973, in iterator_get_next
output_shapes=output_shapes, name=name)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "\Users\jsohw\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\framework\ops.py", line 2005, in __init__
self._traceback = tf_stack.extract_stack()
我设置的参数是:
--train_record
Dataset/AFLW
--val_record
Dataset/lfw_5590
--model_dir
checkpoints
--train_steps
500
--batch_size
32
--export_dir
saved_model
--num_epochs
50
--raw_input #(I'm not sure what this does here but I've included it in my parameters)
True
谁能告诉我问题是什么以及如何解决?我正在使用Python3.7在JetBrains PyCharm上运行此程序,并且我的数据集中有2个文件,称为AFLW和lfw_5590。
很抱歉,我是python的新手,但我不理解所提出的解决方案,所以我重复了这一遍,开始了新的一期。尽早感谢您的帮助。