Comments (5)
@CF2220160244 I get the same error on printing numpy arrays, but I think in my case this is a PyCharm problem. In PyCharm if I convert the numpy array to a torch tensor print
works fine:
labels0 = np.loadtxt(label_path, dtype=np.float32).reshape(-1, 5)
print(labels0)
Traceback (most recent call last):
...
IndexError: tuple index out of range
print(torch.from_numpy(labels0))
tensor([[76.00000, 0.35609, 0.44456, 0.54970, 0.16180],
[ 0.00000, 0.48129, 0.40587, 0.94952, 0.80312]])
In Spyder the same operation shows no errors:
ipdb> labels0 = np.loadtxt(label_path, dtype=np.float32).reshape(-1, 5)
ipdb> labels0
array([[76. , 0.356086, 0.444563, 0.549703, 0.161803],
[ 0. , 0.481289, 0.405874, 0.949516, 0.803123]], dtype=float32)
ipdb> print(labels0)
[[76. 0.356086 0.444563 0.549703 0.161803]
[ 0. 0.481289 0.405874 0.949516 0.803123]]
from yolov3.
The issue seem to be that the print option for float_kind has a typo (https://github.com/ultralytics/yolov3/blob/master/utils/utils.py#L10).
Try changing
np.set_printoptions(linewidth=320, formatter={'float_kind': '{11.5g}'.format})
to
np.set_printoptions(linewidth=320, formatter={'float_kind': '{:11.5g}'.format})
(format
was trying to access the 11th element of the input instead of using 11.5g as formatting)
from yolov3.
@simedw you are right, this fixes the problem! I implemented this change in commit bce94f6.
from yolov3.
@simedw you are right, this fixes the problem! I implemented this change in commit bce94f6.
But this error is not fixed by using th above suggestion
return a.reshape((1, a.shape[0], a.shape[1]))
IndexError: tuple index out of range
from yolov3.
@NaumanKhan665
Hello, thank you for your interest in our work! Please note that most technical problems are due to:
- Your changes to the default repository. If your issue is not reproducible in a fresh
git clone
version of this repository we can not debug it. Before going further run this code and ensure your issue persists:
sudo rm -rf yolov3 # remove exising repo
git clone https://github.com/ultralytics/yolov3 && cd yolov3 # git clone latest
python3 detect.py # verify detection
python3 train.py # verify training (a few batches only)
# CODE TO REPRODUCE YOUR ISSUE HERE
- Your custom data. If your issue is not reproducible with COCO data we can not debug it. Visit our Custom Training Tutorial for exact details on how to format your custom data. Examine
train_batch0.jpg
andtest_batch0.jpg
for a sanity check of training and testing data. - Your environment. If your issue is not reproducible in a GCP Quickstart Guide VM we can not debug it. Ensure you meet the requirements specified in the README: Unix, MacOS, or Windows with Python >= 3.7, Pytorch >= 1.1, etc. You can also use our Google Colab Notebook to test your code in working environment.
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!
from yolov3.
Related Issues (20)
- About the instructions and code comments HOT 3
- A hopelessly long try to replicate the YOLOv3 kernel HOT 2
- Change in the anchor boxes HOT 10
- ❗️Closed per Code of Conduct HOT 1
- no anchor_grid in V9.6.0 yolov3.pt HOT 5
- Convert YOLOv3 dataset format to YOLOv8 HOT 3
- What's the difference between it and Yolov3 by Joseph Redmon ? HOT 7
- Integrating YOLOv8 into YOLOv3 Ultralytics HOT 2
- Seeking Advice on Equivalent YOLOv5 Variant to Standard YOLOv3 HOT 1
- Unexpectedly large trained model size (~200 MB .pt and ~400 MB .onnx) HOT 4
- Training requires much more VRAM than v5/v8 and results in ~200 MB models comparing to <15 MB models of v5/v8 HOT 5
- how to train your yolov8?
- Need info regarding yolov3-tiny anchors, dataset creation and loss function. HOT 5
- Cannot compute loss function from best model HOT 1
- yolov3_ros input topic channel problem HOT 5
- Issue with training YOLOv3-tiny from scratch HOT 4
- yolov3.pt HOT 4
- 关于调用推理代码块遇到的与一些问题 HOT 8
- Bug of incomplete information display HOT 2
- No module named 'ultralytics.yolo' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov3.