ultralytics / yolov5

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

What can i do to solve this issue? AttributeError: module 'test' has no attribute 'test' #838

Closed Floo33R closed 4 years ago

Floo33R commented 4 years ago

❔Question

Hello guys! I ran into an issue. I tried to follow this guide https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data. Everything is working fine until the first Epoch is nearly over. Then it shows the following output:

Traceback (most recent call last): File "train.py", line 462, in <module> train(hyp, opt, device, tb_writer) File "train.py", line 321, in train results, maps, times = test.test(opt.data, AttributeError: module 'test' has no attribute 'test'

Additional context

I'm working on Pop_OS20.04. For the training i use this command: python3 train.py --img 640 --batch 2 --epochs 5 --data ./data/coco128.yaml --cfg ./models/yolov5s.yaml --weights ''

Thanks for the help in advance.

github-actions[bot] commented 4 years ago

Hello @Floo33R, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

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 model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

glenn-jocher commented 4 years ago

@Floo33R probably an environment issue. Recommend you run the Colab tutorials. https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb

Floo33R commented 4 years ago

@Floo33R probably an environment issue. Recommend you run the Colab tutorials. https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb @glenn-jocher So there is no chance to run it on my computer with my own CPU/GPU?

glenn-jocher commented 4 years ago

@Floo33R of course you can run on your own computer. I'll paste our environment guidance.

it appears you may have environment problems. 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.8 or later with all requirements.txt dependencies installed, including torch>=1.6. To install run:

$ 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.

Floo33R commented 4 years ago

I changed to from PopOS to Windows 10 and there it works fine. Thanks for the help!