Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF.js export bug #9534

Closed
1 of 2 tasks
unnellu opened this issue Sep 21, 2022 · 2 comments · Fixed by #9536
Closed
1 of 2 tasks

TF.js export bug #9534

unnellu opened this issue Sep 21, 2022 · 2 comments · Fixed by #9536
Labels
bug Something isn't working

Comments

@unnellu
Copy link

unnellu commented Sep 21, 2022

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Other

Bug

24 hours ago train we normal convert,
!python export.py --weights runs/train/exp/weights/best.pt --include tfjs

but after 24 hours we have this error

TensorFlow.js: starting export with tensorflowjs 3.20.0...
Traceback (most recent call last):
File "/usr/local/bin/tensorflowjs_converter", line 8, in
sys.exit(pip_main())
File "/usr/local/lib/python3.7/dist-packages/tensorflowjs/converters/converter.py", line 827, in pip_main
main([' '.join(sys.argv[1:])])
File "/usr/local/lib/python3.7/dist-packages/tensorflowjs/converters/converter.py", line 831, in main
convert(argv[0].split(' '))
File "/usr/local/lib/python3.7/dist-packages/tensorflowjs/converters/converter.py", line 818, in convert
weight_shard_size_bytes, metadata_map)
File "/usr/local/lib/python3.7/dist-packages/tensorflowjs/converters/converter.py", line 588, in _dispatch_converter
metadata=metadata_map)
File "/usr/local/lib/python3.7/dist-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 522, in convert_tf_frozen_model
graph = load_graph(frozen_model_path)
File "/usr/local/lib/python3.7/dist-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 68, in load_graph
graph_def.ParseFromString(f.read())
File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 114, in read
self._preread_check()
File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 77, in _preread_check
compat.path_to_str(self.__name), 1024 * 512)
tensorflow.python.framework.errors_impl.NotFoundError: runs/train/exp/weights/best.pb; No such file or directory
TensorFlow.js: export failure ❌ 8.3s: [Errno 2] No such file or directory: 'runs/train/exp/weights/best_web_model/model.json'
adding: runs/train/exp/weights/best_web_model/ (stored 0%)

For this branch normal work convert
!git clone --branch 'exp/scaleFill' https://github.com/ultralytics/yolov5 # clone

Environment

YOLOv5 🚀 v6.2-153-g6f02847 Python-3.7.14 torch-1.12.1+cu113 CUDA:0 (Tesla P100-PCIE-16GB, 16281MiB)
Setup complete ✅ (4 CPUs, 25.5 GB RAM, 37.4/166.8 GB disk)

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@unnellu unnellu added the bug Something isn't working label Sep 21, 2022
@glenn-jocher
Copy link
Member

@unnellu thanks for the bug report! I'm able to reproduce, I'll add a TODO to prioritize a fix for this.

glenn-jocher added a commit that referenced this issue Sep 21, 2022
May resolve #9534

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher changed the title In convert have problem TF.js export bug Sep 21, 2022
glenn-jocher added a commit that referenced this issue Sep 21, 2022
* TF.js fix

May resolve #9534

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update ci-testing.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update ci-testing.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* Update ci-testing.yml

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@glenn-jocher
Copy link
Member

@unnellu good news 😃! Your original issue may now be fixed ✅ in PR #9536. To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants