Comments (23)
So I found the solution:
The yolo.h5 file can be generated using the YAD2K repository here: https://github.com/allanzelener/YAD2K
Steps how to do it on windows:
-
Clone the above repository to your computer
-
Download the yolo.weights file from here: http://pjreddie.com/media/files/yolo.weights
-
Download the yolo.cfg file form here: https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolo.cfg
-
Copy the downloaded weights and cfg files to the YAD2K master directory
Run python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
on the shell and the h5 file will be generated.
from deeplearning.ai.
Just go to Yolo website and download it
https://pjreddie.com/darknet/yolo/
from deeplearning.ai.
@miranthajayatilake the link for yolo.cfg not worked.
from deeplearning.ai.
You can get the weights and cfg file from this website.
https://pjreddie.com/darknet/yolo/
The coursera course is using YOLOv2 608 x 608. You will need tensoflow v1 to compile.
from deeplearning.ai.
I get a error message when I run yad2k.py
"Traceback (most recent call last):
File "yad2k.py", line 270, in
_main(parser.parse_args())
File "yad2k.py", line 156, in _main
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array "
Any suggestions?
from deeplearning.ai.
Thanks it helped 👍
from deeplearning.ai.
Use this one:
https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov1.cfg
from deeplearning.ai.
@miranthajayatilake , I am not able to download the configuration file? the link isn't valid! Also, does the Yolo weight corresponds to version2 or version 3?
from deeplearning.ai.
So I found the solution:
The yolo.h5 file can be generated using the YAD2K repository here: https://github.com/allanzelener/YAD2K
Steps how to do it on windows:
- Clone the above repository to your computer
- Download the yolo.weights file from here: http://pjreddie.com/media/files/yolo.weights
- Download the yolo.cfg file form here: https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolo.cfg
- Copy the downloaded weights and cfg files to the YAD2K master directory
Run
python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
on the shell and the h5 file will be generated.
from deeplearning.ai.
Can anyone explain this step. I have downloaded both cfg and weight file. I don't understand where and how to run it?
Run
python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
on the shell and the h5 file will be generated.
from deeplearning.ai.
Folks, this code is from deeplearning.ai/ and you can sign up for their free course and work this out.
from deeplearning.ai.
Can anyone explain this step. I have downloaded both cfg and weight file. I don't understand where and how to run it?
Run
python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
on the shell and the h5 file will be generated.
@Sameedquais
you should run in command prompt or Anaconda prompt with same directory as YAD2K master.
from deeplearning.ai.
how can i run it in google colab?
from deeplearning.ai.
how can i run it in google colab?
- Clone repo using
!git clone https://github.com/allanzelener/YAD2K.git
- Go inside the directory using
os.chdir(folder_name)
- Get the weights with:
!wget https://pjreddie.com/media/files/yolov2-voc.weights
!wget https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov2-voc.cfg
- Run
!python3 yad2k.py yolov2-voc.cfg yolov2-voc.weights model_data/yolov2-voc.h5
Tip: To run any terminal command on colab you can use !
before the command. Refer this
from deeplearning.ai.
I get a error message when I run yad2k.py
"Traceback (most recent call last):
File "yad2k.py", line 270, in
_main(parser.parse_args())
File "yad2k.py", line 156, in _main
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array "
Any suggestions?
Hi, we must make yolo.cfg and yolo.weights have the same version, yolo having many versions like yolo-tiny,yolov1,yolov2,yolov3....
from deeplearning.ai.
You can get the weights and cfg file from this website.
https://pjreddie.com/darknet/yolo/The coursera course is using YOLOv2 608 x 608. You will need tensoflow v1 to compile.
Hi, but to degrade tensorflow to v1, yolo.utils is using keras which needs tf v>2.0 then how to proceed? and while using yolov2 h5 file in tf version 2.4.0, its giving error "yad2k.models.keras_yolo is not loaded, but a Lambda layer uses it. It may cause errors." while loading model. any suggestions please?
from deeplearning.ai.
Can anyone explain this step. I have downloaded both cfg and weight file. I don't understand where and how to run it?
Run
python yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
on the shell and the h5 file will be generated.
Could you help me how to copy cfg and weigth file on master directory in google colab? I got error when I want to runpython yad2k.py yolo.cfg yolo.weights model_data/yolo.h5
on the shell and the h5
from deeplearning.ai.
thank you
from deeplearning.ai.
anybody have a pre trained yolo 1 weight.h5 file ?
from deeplearning.ai.
I get a error message when I run yad2k.py
"Traceback (most recent call last):
File "yad2k.py", line 270, in
_main(parser.parse_args())
File "yad2k.py", line 156, in _main
buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array "
Any suggestions?Hi, we must make yolo.cfg and yolo.weights have the same version, yolo having many versions like yolo-tiny,yolov1,yolov2,yolov3....
I have the same version, it is still showing this error
from deeplearning.ai.
for anyone who still has this problem in tensorflow 2,go to original website of yolov2 and download darknet and weights file,find yolo config in darknet folder, then using yad2k you can easily generate .h5 file,(when running yad2k.py you get bunch of import errors that you have to manually correct them because of new version of tensorflow)
yolo v2site:
https://pjreddie.com/darknet/yolov2/
installing yad2k:
git clone https://github.com/allanzelener/yad2k.git
put config and weight file inside yad2k folder
if you get space_to_depth err, go to the corresponding line and change it to tf.nn.space_to_depth
from deeplearning.ai.
I am getting the following error:
Loading weights.
Weights Header: [ 0 1 0 32013312]
Parsing Darknet config.
Traceback (most recent call last):
File "C:\Users\tsoam\Downloads\YAD2K\yad2k.py", line 274, in
_main(parser.parse_args())
File "C:\Users\tsoam\Downloads\YAD2K\yad2k.py", line 95, in _main
cfg_parser.read_file(unique_config_file)
File "C:\Users\tsoam\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 733, in read_file
self._read(f, source)
File "C:\Users\tsoam\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 1100, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
Note: I have already manually corrected import statements as I am using tf 2.13, Python version 3.11.
from deeplearning.ai.
I am getting the following error:
Loading weights. Weights Header: [ 0 1 0 32013312] Parsing Darknet config. Traceback (most recent call last): File "C:\Users\tsoam\Downloads\YAD2K\yad2k.py", line 274, in _main(parser.parse_args()) File "C:\Users\tsoam\Downloads\YAD2K\yad2k.py", line 95, in _main cfg_parser.read_file(unique_config_file) File "C:\Users\tsoam\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 733, in read_file self._read(f, source) File "C:\Users\tsoam\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 1100, in _read raise MissingSectionHeaderError(fpname, lineno, line) configparser.MissingSectionHeaderError: File contains no section headers.
Note: I have already manually corrected import statements as I am using tf 2.13, Python version 3.11.
I solved this by directly downloading yolov2.cfg from GitHub repo rather than using curl. I think curl messes up the format of the file.
from deeplearning.ai.
Related Issues (15)
- Some answers are not correct HOT 1
- Error in Week 3/ Object Detection
- Week 1 Error
- inception_blocks_v2.py
- YOLO algorithm on Videos HOT 2
- I get a error message when I run yad2k.py
- In generate_colors why are we multiplying by 255 after converting to rgb?
- Convert .h5(Yolov5) file to .pb file
- Question about Face Verification HOT 2
- How to load the pretrained weights file for FaceNet? HOT 3
- Sequence Model HOT 9
- not have images folders HOT 1
- Error in Week 4 / NST HOT 1
- Error in Week4 / NST HOT 1
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 deeplearning.ai.