我正在使用ultralytics版本8.0.20 5o火车yolov8模型。 我已完成培训和测试,我想导出我的模式以在我的服务器上使用它。 在我的服务器中没有 ultralytics 软件包,我只安装了 pytorch 和 tensorflow。 当我使用办公室官方文档中的这条线时,我得到了这个结果
!yolo export model={HOME}/runs/detect/train/weights/best.pt format=saved_model imgsz= 1024 # export custom trained model
2023-05-27 16:49:11.934911: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-05-27 16:49:12.893349: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Ultralytics YOLOv8.0.20 🚀 Python-3.10.11 torch-2.0.1+cu118 CUDA:0 (Tesla T4, 15102MiB)
Model summary (fused): 168 layers, 11125971 parameters, 0 gradients, 28.4 GFLOPs
PyTorch: starting from /content/runs/detect/train/weights/best.pt with output shape (1, 5, 21504) (21.5 MB)
Traceback (most recent call last):
File "/usr/local/bin/yolo", line 8, in <module>
sys.exit(entrypoint())
File "/usr/local/lib/python3.10/dist-packages/ultralytics/yolo/cfg/__init__.py", line 249, in entrypoint
getattr(model, mode)(verbose=True, **overrides)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/ultralytics/yolo/engine/model.py", line 182, in export
exporter(model=self.model)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/ultralytics/yolo/engine/exporter.py", line 213, in __call__
raise NotImplementedError('YOLOv8 TensorFlow export support is still under development. '
NotImplementedError: YOLOv8 TensorFlow export support is still under development. Please consider contributing to the effort if you have TF expertise. Thank you!
目前好像没有导出功能。 有什么方法可以将我的模型保存为 tf、keras 或 pytorch 模型,然后加载它们(仅用于推理),而无需使用 ultralytics pack。
提前谢谢你
发生这种情况的原因有多种,包括 PyTorch、ONNX 和 TensorRT 之间的版本不兼容、ONNX 和 TensorRT 不支持输入或其他原因。
如果没有错误消息,就很难诊断问题的确切根源。您可以尝试以下几件事来解决此问题:
如果这些解决方案都不起作用,您能否在您的环境中详细运行该命令以获得更详细的错误消息?这将帮助我们为您的问题提供更准确的解决方案。