请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

模型训练的时候一直报错

2021-12-04 01:27:42.262609: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:tensorflow:There are non-GPU devices in tf.distribute.Strategy, not using nccl allreduce.
W1204 01:27:42.263748 4480232896 cross_device_ops.py:1387] There are non-GPU devices in tf.distribute.Strategy, not using nccl allreduce.
INFO:tensorflow:Using MirroredStrategy with devices (’/job:localhost/replica:0/task:0/device:CPU:0’,)
I1204 01:27:42.265084 4480232896 mirrored_strategy.py:369] Using MirroredStrategy with devices (’/job:localhost/replica:0/task:0/device:CPU:0’,)
Traceback (most recent call last):
File “object_detection/model_main_tf2.py”, line 115, in
tf.compat.v1.app.run()
File “/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/platform/app.py”, line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File “/opt/anaconda3/lib/python3.7/site-packages/absl/app.py”, line 312, in run
_run_main(main, args)
File “/opt/anaconda3/lib/python3.7/site-packages/absl/app.py”, line 258, in _run_main
sys.exit(main(argv))
File “object_detection/model_main_tf2.py”, line 112, in main
record_summaries=FLAGS.record_summaries)
File “/Users/admin/Downloads/models-master/research/object_detection/model_lib_v2.py”, line 499, in train_loop
pipeline_config_path, config_override=config_override)
File “/Users/admin/Downloads/models-master/research/object_detection/utils/config_util.py”, line 138, in get_configs_from_pipeline_file
proto_str = f.read()
File “/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/lib/io/file_io.py”, line 117, in read
self._preread_check()
File “/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/lib/io/file_io.py”, line 80, in _preread_check
compat.path_to_str(self.__name), 1024 * 512)
TypeError: init(): incompatible constructor arguments. The following argument types are supported:
1. tensorflow.python.lib.io._pywrap_file_io.BufferedInputStream(filename: str, buffer_size: int, token: tensorflow.python.lib.io._pywrap_file_io.TransactionToken = None)

Invoked with: None, 524288

正在回答 回答被采纳积分+3

1回答

会写代码的好厨师 2021-12-10 11:24:24

检查版本,要使用1.13版本或者1.14.不要用2.0以上的版本。

tf1和tf2有很大区别,很多地方不兼容。

检查GPU和CPU版本是不是搞混了。

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信