如何解决将我的数据集转换为 TFrecord 格式以在 colab 中运行 Deeplabs 时出错
我正在尝试在 Colab 中的自定义数据集上运行 Deeplabs。 我想将我的数据集转换为 TFRecord 格式,但是当我运行 build_voc2012_data.py 文件时出现错误。有人能告诉我为什么我得到它以及如何摆脱它吗?
!python build_voc2012_data.py \
--image_folder="./skin_lesion/JPEGImages" \
--semantic_segmentation_folder="./skin_lesion/SegmentationClass" \
--list_folder="./skin_lesion/imagesets/Segmentation" \
--image_format="jpg" \
--output_dir="./tfrecord"
2020-12-28 06:34:25.620292: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
2020-12-28 06:34:28.833301: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices,tf_xla_enable_xla_devices not set
2020-12-28 06:34:28.866544: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
2020-12-28 06:34:28.929087: E tensorflow/stream_executor/cuda/cuda_driver.cc:328] Failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2020-12-28 06:34:28.929146: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (a0267f2cdac9): /proc/driver/nvidia/version does not exist
2020-12-28 06:34:28.929781: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices,tf_xla_enable_xla_devices not set
2020-12-28 06:34:28.933455: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices,tf_xla_enable_xla_devices not set
Processing trainTraceback (most recent call last):
File "build_voc2012_data.py",line 147,in <module>
tf.app.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py",line 40,in run
_run(main=main,argv=argv,flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py",line 300,in run
_run_main(main,args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py",line 251,in _run_main
sys.exit(main(argv))
File "build_voc2012_data.py",line 143,in main
_convert_dataset(dataset_split)
File "build_voc2012_data.py",line 112,in _convert_dataset
with tf.python_io.TFRecordWriter(output_filename) as tfrecord_writer:
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/tf_record.py",line 299,in __init__
compat.as_bytes(path),options._as_record_writer_options())
tensorflow.python.framework.errors_impl.NotFoundError: ./tfrecord/train-00000-of-00004.tfrecord; No such file or directory
解决方法
由于错误清楚地表明这是 tfrecord 输出目录的 No such file or directory
问题。
您可以在output_dir
中提及绝对路径,在colab中您可以右键单击文件夹和copy path
以获取目录的绝对路径。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。