GithubHelp home page GithubHelp logo

Comments (19)

Halkyon64 avatar Halkyon64 commented on July 23, 2024 1

Same problem here. Tried all possible mirrors for yolov4 weights.
But I've made only one change to convert.py: replaced from keras import backend as K to import tensorflow.python.keras.backend as K, because original import caused another problem:
AttributeError: module 'keras.backend' has no attribute 'get_session'

from keras-yolo4.

Runist avatar Runist commented on July 23, 2024

I meet the problem too.I search in Google,somebody say that it maybe your keras model isn't match yolov4.weights.So I try to figure out.

from keras-yolo4.

Runist avatar Runist commented on July 23, 2024

Traceback (most recent call last):
File "convert.py", line 173, in
yolo4_model = Yolo4(score, iou, anchors_path, classes_path, model_path, weights_path)
File "convert.py", line 157, in init
self.load_yolo()
File "convert.py", line 130, in load_yolo
buffer=weights_file.read(weights_size * 4))

I solve the problem,but I use my code.Here is link.Besides, my keras model is mismatch the AlexeyAB-version.So I just load csp-darknet.

from keras-yolo4.

ybloch avatar ybloch commented on July 23, 2024

Got the same issue when I tried to convert my tiny-yolov4, trained with AlexeyAB darknet version

from keras-yolo4.

JoshieLim avatar JoshieLim commented on July 23, 2024

I've got this error as well. Did anyone manage to solve it?

from keras-yolo4.

Melkeydev avatar Melkeydev commented on July 23, 2024

any updates?

from keras-yolo4.

JoshieLim avatar JoshieLim commented on July 23, 2024

@Amokstakov I've retrained my data by setting image size to (608,608) in yolov4-custom config file and it works.

from keras-yolo4.

Melkeydev avatar Melkeydev commented on July 23, 2024

@JoshieLim I am struggling converting the downloaded yolo_4.weights file to the yolo4.h5 file using the conver.py
Any insight into this? I am lookign and the convert.py never actually references the .cfg file for yolo4?

from keras-yolo4.

JoshieLim avatar JoshieLim commented on July 23, 2024

@Amokstakov Hmm that's odd. I'm able to convert to .h5 on my end. Did you set the anchors path to a yolo4_anchors? It should look something like this for yolov4 anchors 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401.

from keras-yolo4.

Melkeydev avatar Melkeydev commented on July 23, 2024

Still no luck here.
Would it be too much trouble to ask for a direct step-by-step of what you did @JoshieLim

like from GitClone... what are the next steps into running the detect then test.py code?

from keras-yolo4.

xellDart avatar xellDart commented on July 23, 2024

Any update?

from keras-yolo4.

JoshieLim avatar JoshieLim commented on July 23, 2024

@Amokstakov Can you try to convert this yolov4.weights from this link. See if it works.

#get yolov4 pre-trained weights
!wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights

from keras-yolo4.

MuhammadAsadJaved avatar MuhammadAsadJaved commented on July 23, 2024

@ybloch Hi, Have you managed to convert tiny_yolov4.weights to .h5? It's pre-trained tiny_yolov4, not custom tiny_yolov4 model.

from keras-yolo4.

ybloch avatar ybloch commented on July 23, 2024

@MuhammadAsadJaved Hi,
I could not convert it to H5 so I converted it to a TensorFlow model and with it, I use for production.
Here's how I did it:
Using repo: [https://github.com/hunglc007/tensorflow-yolov4-tflite]

  • git clone https://github.com/hunglc007/tensorflow-yolov4-tflite

  • cd tensorflow-yolov4-tflite

  • sudo python3 save_model.py --weights yolov4-tiny-custom_final.weights --output ./checkpoints/yolov4_v1_darknet-416 --input_size 416 --model yolov4 --framework tflite

  • sudo python3 convert_tflite.py --weights ./checkpoints/yolov4_v1_darknet-416 --quantize_mode fp16 --output ./checkpoints/yolov4_v1_darknet-416_fp16.tflite

You will find in this project an example of using the converted model

from keras-yolo4.

MuhammadAsadJaved avatar MuhammadAsadJaved commented on July 23, 2024

@ybloch OK. Thanks for sharing dear. Actually I need keras model for some other project (tiny_yolov4+deep_sort). It's a project for detection and then applying tracker on detections.

from keras-yolo4.

Shridharpawar77 avatar Shridharpawar77 commented on July 23, 2024

did anyone manage to convert the model? If yes, please help

from keras-yolo4.

maazullah96 avatar maazullah96 commented on July 23, 2024

Thank @Runist for you comment I have converted yolov4.weights file to .h5 file using Runist YOLOV4 Repository "

from keras-yolo4.

Mahmood-Hussain avatar Mahmood-Hussain commented on July 23, 2024

YOLOV4 Repository

@maazullah96 this shows 404

from keras-yolo4.

Saqueeb avatar Saqueeb commented on July 23, 2024

Having same issue.
Did anyone convert custom trained yolov4 to .h5 model? If yes, then can you please share the steps here?

from keras-yolo4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.