ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
51.22k stars 16.44k forks source link

train and detect question #575

Closed china56321 closed 4 years ago

china56321 commented 4 years ago

Hi, error happend when train and detect, i have tried many times,all eror are same, i don't know why this happend,could you help me solve this problem ? thank you ! ( i recloned the repo ) training error: File "train.py", line 47 print(f'Hyperparameters {hyp}') ^ SyntaxError: invalid syntax

detect eror : Traceback (most recent call last): File "detect.py", line 5, in from models.experimental import File "/home/make/yolov5/models/experimental.py", line 3, in from models.common import File "/home/make/yolov5/models/common.py", line 3, in from utils.utils import * File "/home/make/yolov5/utils/utils.py", line 55 last_list = glob.glob(f'{search_dir}/*/last.pt', recursive=True) ^ SyntaxError: invalid syntax

glenn-jocher commented 4 years ago

@china56321 don't know. You could try a different environment:

Reproduce Our Environment

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

gaasing commented 4 years ago

I have the same question

china56321 commented 4 years ago

I have the same question

Have you solved it ?

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

saimanoj18 commented 4 years ago

I have the same question

activate your conda environment conda activate ml_env

saimanoj18 commented 4 years ago

I have the same question

Have you solved it ?

activate your conda environment conda activate ml_env

SantoshAhirrao commented 3 years ago

image Can anyone help to find the error

glenn-jocher commented 3 years ago

@SantoshAhirrao your command looks fine, error could be due to modified or out of date code. I'll post our default reply here which may help.

Please note that most technical problems are due to:

CODE TO REPRODUCE YOUR ISSUE HERE


- **Your custom data.** If your issue is not reproducible in one of our 3 common datasets ([COCO](https://github.com/ultralytics/yolov5/blob/master/data/coco.yaml), [COCO128](https://github.com/ultralytics/yolov5/blob/master/data/coco128.yaml), or [VOC](https://github.com/ultralytics/yolov5/blob/master/data/voc.yaml)) we can not debug it. Visit our [Custom Training Tutorial](https://docs.ultralytics.com/yolov5/tutorials/train_custom_data) for guidelines on training your custom data. Examine `train_batch0.jpg` and `test_batch0.jpg` for a sanity check of your labels and images.

- **Your environment.** If your issue is not reproducible in one of the verified environments below we can not debug it. If you are running YOLOv5 locally, verify your environment meets all of the [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) dependencies specified below. If in doubt, download Python 3.8.0 from https://www.python.org/, create a new [venv](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/), and then install requirements.

If none of these apply to you, we suggest you close this issue and raise a new one using the **Bug Report template**, providing screenshots and **minimum viable code to reproduce your issue**. Thank you!

## Requirements

Python 3.8 or later with all [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) dependencies installed, including `torch>=1.7`. To install run:
```bash
$ 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 passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu.