ultralytics / yolov5

YOLOv5 πŸš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
51.2k stars 16.43k forks source link

export.py to tfjs problem:No such file or directory: 'yolov5s_web_model/model.json' #5941

Closed maheluyao429 closed 2 years ago

maheluyao429 commented 2 years ago

Search before asking

YOLOv5 Component

No response

Bug

when I run " python export.py --include tfjs " get an error

**KeyError: 'The name "\'Identity" refers to an Operation not in the graph.'

TensorFlow.js: export failure: [Errno 2] No such file or directory: 'yolov5s_web_model/model.json'**

β€˜yolov5s_web_model’ is an empty folder, there is nothing in it

5X{EMZ4ZZWA)2Z4M$VJ@TPV

Environment

No response

Minimal Reproducible Example

python export.py --include tfjs

Additional

No response

Are you willing to submit a PR?

github-actions[bot] commented 2 years ago

πŸ‘‹ Hello @maheluyao429, thank you for your interest in YOLOv5 πŸš€! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a πŸ› Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

glenn-jocher commented 2 years ago

@maheluyao429 πŸ‘‹ hi, thanks for letting us know about this possible problem with YOLOv5 πŸš€. We are not able to reproduce your issue. YOLOv5 TF.js export works correctly:

python export.py --include tfjs
Screen Shot 2021-12-10 at 2 46 39 PM

We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem.

How to create a Minimal, Reproducible Example

When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:

For Ultralytics to provide assistance your code should also be:

If you believe your problem meets all the above criteria, please close this issue and raise a new one using the πŸ› Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.

Thank you! πŸ˜ƒ

maheluyao429 commented 2 years ago

7)T2C09T$IT{M1{}ST@P{SG @glenn-jocher

glenn-jocher commented 2 years ago

@maheluyao429 πŸ‘‹ hi, thanks for letting us know about this possible problem with YOLOv5 πŸš€. We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem.

How to create a Minimal, Reproducible Example

When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:

For Ultralytics to provide assistance your code should also be:

If you believe your problem meets all the above criteria, please close this issue and raise a new one using the πŸ› Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.

Thank you! πŸ˜ƒ

Tears1997 commented 2 years ago

I have the same problem. image @glenn-jocher

glenn-jocher commented 2 years ago

@Tears1997 πŸ‘‹ hi, thanks for letting us know about this possible problem with YOLOv5 πŸš€. We are not able to reproduce your issue. YOLOv5 TF.js export works correctly:

python export.py --include tfjs
Screen Shot 2021-12-10 at 2 46 39 PM

We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem.

How to create a Minimal, Reproducible Example

When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:

For Ultralytics to provide assistance your code should also be:

If you believe your problem meets all the above criteria, please close this issue and raise a new one using the πŸ› Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.

Thank you! πŸ˜ƒ

airwalk741 commented 2 years ago

@glenn-jocher I used the below command and got the same error. (python 3.9.6)

python -m venv venv
git clone https://github.com/ultralytics/yolov5.git
cd yolov5
pip install -r requirements.txt 
pip install 'tensorflowjs'
python export.py --include tfjs

I removed the '' and the error went away. export.py

cmd = f"tensorflowjs_converter --input_format=tf_frozen_model " \
              f"--output_node_names=Identity,Identity_1,Identity_2,Identity_3 {f_pb} {f}"

@maheluyao429 @Tears1997

glenn-jocher commented 2 years ago

@airwalk741 it appears you may have environment problems.

image

Please ensure you meet all dependency requirements if you are attempting to run YOLOv5 locally. If in doubt, create a new virtual Python 3.8 environment, clone the latest repo (code changes daily), and pip install -r requirements.txt again. We also highly recommend using one of our verified environments below.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

github-actions[bot] commented 2 years ago

πŸ‘‹ Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 πŸš€ resources:

Access additional Ultralytics ⚑ resources:

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 YOLOv5 πŸš€ and Vision AI ⭐!