ultralytics / ultralytics

NEW - YOLOv8 πŸš€ in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
25.84k stars 5.15k forks source link

TensorFlow.js: export failure #13026

Closed MahitejVardhan closed 1 day ago

MahitejVardhan commented 1 month ago

Ultralytics YOLOv8.2.19 πŸš€ Python-3.10.12 torch-2.3.0+cu121 CPU (Intel Xeon 2.00GHz) Model summary (fused): 218 layers, 25840339 parameters, 0 gradients, 78.7 GFLOPs

PyTorch: starting from '/content/runs/detect/train4/weights/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 5, 8400) (49.6 MB)

TensorFlow SavedModel: starting export with tensorflow 2.13.1...

ONNX: starting export with onnx 1.16.0 opset 17... ONNX: simplifying with onnxsim 0.4.36... ONNX: export success βœ… 8.0s, saved as '/content/runs/detect/train4/weights/best.onnx' (98.7 MB) TensorFlow SavedModel: starting TFLite export with onnx2tf 1.17.5... TensorFlow SavedModel: export success βœ… 36.8s, saved as '/content/runs/detect/train4/weights/best_saved_model' (247.1 MB)

TensorFlow GraphDef: starting export with tensorflow 2.13.1... TensorFlow GraphDef: export success βœ… 3.4s, saved as '/content/runs/detect/train4/weights/best.pb' (98.8 MB) WARNING:root:TensorFlow Decision Forests 1.9.1 is compatible with the following TensorFlow Versions: ['2.16.1']. However, TensorFlow 2.13.1 was detected. This can cause issues with the TF API and symbols in the custom C++ ops. See the TF and TF-DF compatibility table at https://github.com/tensorflow/decision-forests/blob/main/documentation/known_issues.md#compatibility-table. WARNING:root:Failure to load the inference.so custom c++ tensorflow ops. This error is likely caused the version of TensorFlow and TensorFlow Decision Forests are not compatible. Full error:/usr/local/lib/python3.10/dist-packages/tensorflow_decision_forests/tensorflow/ops/inference/inference.so: undefined symbol: _ZN10tensorflow20OpKernelConstruction21CtxFailureWithWarningEPKciRKN4absl12lts_202308026StatusE TensorFlow.js: export failure ❌ 0.0s: /usr/local/lib/python3.10/dist-packages/tensorflow_decision_forests/tensorflow/ops/inference/inference.so: undefined symbol: _ZN10tensorflow20OpKernelConstruction21CtxFailureWithWarningEPKciRKN4absl12lts_202308026StatusE

NotFoundError Traceback (most recent call last) in <cell line: 4>() 2 3 # Export the model ----> 4 model.export(format='tfjs')

18 frames /usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename) 52 RuntimeError: when unable to load the library or get the python wrappers. 53 """ ---> 54 lib_handle = py_tf.TF_LoadLibrary(library_filename) 55 try: 56 wrappers = _pywrap_python_op_gen.GetPythonWrappers(

NotFoundError: /usr/local/lib/python3.10/dist-packages/tensorflow_decision_forests/tensorflow/ops/inference/inference.so: undefined symbol: _ZN10tensorflow20OpKernelConstruction21CtxFailureWithWarningEPKciRKN4absl12lts_202308026StatusE

MahitejVardhan commented 1 month ago

What I have to downgrade Either Tensorflow or tensorflow decision forests?

On Thu, 23 May, 2024, 12:30β€―am Glenn Jocher, @.***> wrote:

@MahitejVardhan https://github.com/MahitejVardhan you need to downgrade your TF, see your warning message:

WARNING:root:TensorFlow Decision Forests 1.9.1 is compatible with the following TensorFlow Versions: ['2.16.1']. However, TensorFlow 2.13.1 was detected.

β€” Reply to this email directly, view it on GitHub https://github.com/ultralytics/ultralytics/issues/13026#issuecomment-2125544186, or unsubscribe https://github.com/notifications/unsubscribe-auth/A734CGLQUEBWQKQSI6BMWALZDTTNXAVCNFSM6AAAAABIEDOUT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRVGU2DIMJYGY . You are receiving this because you were mentioned.Message ID: @.***>

glenn-jocher commented 1 month ago

You should upgrade your TensorFlow to version 2.16.1 to ensure compatibility with TensorFlow Decision Forests 1.9.1. This should resolve the compatibility issues you're experiencing. Here's how you can upgrade:

pip install tensorflow==2.16.1

Let us know if this helps or if you encounter any further issues! πŸš€

MahitejVardhan commented 1 month ago

Thank you for your help!

On Fri, 24 May, 2024, 12:58β€―pm Glenn Jocher, @.***> wrote:

You should upgrade your TensorFlow to version 2.16.1 to ensure compatibility with TensorFlow Decision Forests 1.9.1. This should resolve the compatibility issues you're experiencing. Here's how you can upgrade:

pip install tensorflow==2.16.1

Let us know if this helps or if you encounter any further issues! πŸš€

β€” Reply to this email directly, view it on GitHub https://github.com/ultralytics/ultralytics/issues/13026#issuecomment-2128789548, or unsubscribe https://github.com/notifications/unsubscribe-auth/A734CGIKYGTNOPZBA5EISA3ZD3T2PAVCNFSM6AAAAABIEDOUT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRYG44DSNJUHA . You are receiving this because you were mentioned.Message ID: @.***>

glenn-jocher commented 1 month ago

@MahitejVardhan you're welcome! If upgrading to TensorFlow 2.16.1 resolves the issue or if you have any more questions, feel free to reach out. Happy coding! πŸš€

github-actions[bot] commented 2 weeks ago

πŸ‘‹ Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO πŸš€ and Vision AI ⭐