我正在尝试在windows 10中使用tensorflow gpu 2.4.0进行对象检测。我不知道如何纠正这个错误,你能帮我吗?
(tensorflow1) C:tensorflow1modelsresearchobject_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
2021-01-06 17:59:49.219069: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
Traceback (most recent call last):
File "train.py", line 53, in <module>
from object_detection.builders import model_builder
File "C:tensorflow1modelsresearchobject_detectionbuildersmodel_builder.py", line 66, in <module>
from object_detection.models import ssd_efficientnet_bifpn_feature_extractor as ssd_efficientnet_bifpn
File "C:tensorflow1modelsresearchobject_detectionmodelsssd_efficientnet_bifpn_feature_extractor.py", line 33, in <module>
from official.vision.image_classification.efficientnet import efficientnet_model
File "C:tensorflow1modelsofficialvisionimage_classificationefficientnetefficientnet_model.py", line 32, in <module>
from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'
提前谢谢!
数据类(https://docs.python.org/3/library/dataclasses.html)在Python 3.7中引入。根据您发布的错误消息,我得出结论,您没有使用Python 3.7或更高版本。文档正式声明您需要Python 3.5–3.8(https://www.tensorflow.org/install),所以不要使用最新版本的3.9。但实际上,您正在使用的文件需要数据类,因此需要3.7或更高版本。我建议升级到Python 3.8以最大限度地提高兼容性。