hhk7734 / tensorflow-yolov4

YOLOv4 Implemented in Tensorflow 2.
MIT License
136 stars 75 forks source link

TypeError #17

Closed IlkayW closed 4 years ago

IlkayW commented 4 years ago

Hi,

I use the following code:

from yolov4.tf import YOLOv4 yolo = YOLOv4(tiny=True) yolo.classes = "coco.names" yolo.make_model()

with tensorflow version: 2.1.0 and numpy version: 1.19.0, but i end up with the following error:

File "C:\Users\iwu\Documents\Python Scripts\YoloEnv\Scripts\TryAndError\PipYOLOv4.py", line 23, in <module>
    yolo.make_model()

  File "C:\Users\iwu\AppData\Local\Continuum\anaconda3\envs\tf2\lib\site-packages\yolov4\tf\__init__.py", line 76, in make_model
    activation1=activation1,

  File "C:\Users\iwu\AppData\Local\Continuum\anaconda3\envs\tf2\lib\site-packages\yolov4\model\yolov4.py", line 48, in __init__
    activation0=activation0, activation1=activation1

  File "C:\Users\iwu\AppData\Local\Continuum\anaconda3\envs\tf2\lib\site-packages\yolov4\model\backbone.py", line 148, in __init__
    super(CSPDarknet53, self).__init__(name="CSPDarknet53")

TypeError: super(type, obj): obj must be an instance or subtype of type

seems like there's an issue with the super charging. Same error occurs for YOLOv4(tiny=False). Do you have any idea what causes this error?

Greetings, Ilkay

hhk7734 commented 4 years ago

Change super(CSPDarknet53, self).__init__(name="CSPDarknet53") to super().__init__(name="CSPDarknet53"). try again.

What your python version?

IlkayW commented 4 years ago

I am using python 3.7.

I tried to change it and reran the default code in order to get the appropriate line... But for whatever reason it is working now, without any changes. I'm confused 😄

hhk7734 commented 4 years ago

It happens. :)

IlkayW commented 4 years ago

Do you think training TinyYOLOv4 with your environment gives comparable results to the Alexey Darknet Framework?

hhk7734 commented 4 years ago

Not yet. Because of that, I'm testing a lot lately.