Giter Club home page Giter Club logo

yolov-4's People

Contributors

robotedh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yolov-4's Issues

Can I train different size images with this with my own dataset

Hi I have a dataset with images of size 640x512 and label txt files in the following format "0 311.489379882812 204.399459838867 36.0547180175781 24.1059265136719" i-e classs labels , x, y,w,h for the bounding boxes.
Can i try this notebook with this
will I need to use the pretrained weights?
Also I think I dont need to modify the dataset as done in the notebook.
Please help I have been stuck at this for like 4 5 days

Training issues (GPU Tensorflow)

Maybe it's been a while since this forum was updated, but I'll try ;).

I am trying to train the network. For this I have followed the YoloV4_Train_tf.ipynb source. I've had to change a few things: it seems that the mish function was missing to be registered, and I've tried it with and without, the latter changing the activation on the network to weakyrReLU). In both cases, I find very high losses that are difficult to lower (it starts at 50's and stays around 25's... and very low accuracy = 0.00...). In fact...the accuracy is decreasing! What could by happening?

thanks in advance

Some questions on the code.

I've been going through your training notebook and have a few questions. BTW: Thank you very much for this project it is helping me to understand the model.

  • Do you implement the "Bag of Freebies" augmentations?
  • Also, the CIoU, GIoU losses?
  • Similarly: Where is the NMS implemented? I see NMS_THRESHOLD assigned in cell 12 of YoloV4_tf but not ever checked. Is NMS implemented as part of the custom loss code?

Best regards.

load_model error

Dear Sir,

Thank you very much for your beautifull work ! I'm not an expert, I just started 9 months ago as a hobby, most of my learnings coming from Jason Brownlee's - machine_learning_mastery - books including YoloV3 tutorials.
Everything works perfectly except the fact that I cannot load the model !

yolo_model = load_model(...) gives the following error : "ValueError: Unknown activation function: Mish" !

Many thanks and kind regards

Dragos Stan

""

ValueError Traceback (most recent call last)
in
2
3 from keras.models import load_model, Model
----> 4 yolo_model = load_model('YOLO/YOLO_V4/YoloV4_model.h5')

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/saving/save.py in load_model(filepath, custom_objects, compile, options)
180 if (h5py is not None and (
181 isinstance(filepath, h5py.File) or h5py.is_hdf5(filepath))):
--> 182 return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
183
184 filepath = path_to_string(filepath)

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/saving/hdf5_format.py in load_model_from_hdf5(filepath, custom_objects, compile)
176 model_config = json.loads(model_config.decode('utf-8'))
177 model = model_config_lib.model_from_config(model_config,
--> 178 custom_objects=custom_objects)
179
180 # set weights

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/saving/model_config.py in model_from_config(config, custom_objects)
53 'Sequential.from_config(config)?')
54 from tensorflow.python.keras.layers import deserialize # pylint: disable=g-import-not-at-top
---> 55 return deserialize(config, custom_objects=custom_objects)
56
57

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/layers/serialization.py in deserialize(config, custom_objects)
173 module_objects=LOCAL.ALL_OBJECTS,
174 custom_objects=custom_objects,
--> 175 printable_module_name='layer')

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
356 custom_objects=dict(
357 list(_GLOBAL_CUSTOM_OBJECTS.items()) +
--> 358 list(custom_objects.items())))
359 with CustomObjectScope(custom_objects):
360 return cls.from_config(cls_config)

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in from_config(cls, config, custom_objects)
615 """
616 input_tensors, output_tensors, created_layers = reconstruct_from_config(
--> 617 config, custom_objects)
618 model = cls(inputs=input_tensors, outputs=output_tensors,
619 name=config.get('name'))

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in reconstruct_from_config(config, custom_objects, created_layers)
1202 # First, we create all layers and enqueue nodes to be processed
1203 for layer_data in config['layers']:
-> 1204 process_layer(layer_data)
1205 # Then we process nodes in order of layer depth.
1206 # Nodes that cannot yet be processed (if the inbound node

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in process_layer(layer_data)
1184 from tensorflow.python.keras.layers import deserialize as deserialize_layer # pylint: disable=g-import-not-at-top
1185
-> 1186 layer = deserialize_layer(layer_data, custom_objects=custom_objects)
1187 created_layers[layer_name] = layer
1188

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/layers/serialization.py in deserialize(config, custom_objects)
173 module_objects=LOCAL.ALL_OBJECTS,
174 custom_objects=custom_objects,
--> 175 printable_module_name='layer')

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
358 list(custom_objects.items())))
359 with CustomObjectScope(custom_objects):
--> 360 return cls.from_config(cls_config)
361 else:
362 # Then cls may be a function returning a class.

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in from_config(cls, config)
695 A layer instance.
696 """
--> 697 return cls(**config)
698
699 def compute_output_shape(self, input_shape):

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/layers/core.py in init(self, activation, **kwargs)
422 super(Activation, self).init(**kwargs)
423 self.supports_masking = True
--> 424 self.activation = activations.get(activation)
425
426 def call(self, inputs):

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs)
199 """Call target, and fall back on dispatchers if there is a TypeError."""
200 try:
--> 201 return target(*args, **kwargs)
202 except (TypeError, ValueError):
203 # Note: convert_to_eager_tensor currently raises a ValueError, not a

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/activations.py in get(identifier)
529 return deserialize(identifier)
530 elif isinstance(identifier, dict):
--> 531 return deserialize(identifier)
532 elif callable(identifier):
533 return identifier

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs)
199 """Call target, and fall back on dispatchers if there is a TypeError."""
200 try:
--> 201 return target(*args, **kwargs)
202 except (TypeError, ValueError):
203 # Note: convert_to_eager_tensor currently raises a ValueError, not a

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/activations.py in deserialize(name, custom_objects)
490 module_objects=globals(),
491 custom_objects=custom_objects,
--> 492 printable_module_name='activation function')
493
494

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
345 config = identifier
346 (cls, cls_config) = class_and_config_for_serialized_keras_object(
--> 347 config, module_objects, custom_objects, printable_module_name)
348
349 if hasattr(cls, 'from_config'):

/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py in class_and_config_for_serialized_keras_object(config, module_objects, custom_objects, printable_module_name)
294 cls = get_registered_object(class_name, custom_objects, module_objects)
295 if cls is None:
--> 296 raise ValueError('Unknown ' + printable_module_name + ': ' + class_name)
297
298 cls_config = config['config']

ValueError: Unknown activation function: Mish
""

Train using darknet command line

Hi,

Do you know how i can train using AlexAB's compiled darknet on some other system?
Say I cloned and complied the darknet on system A. Now I want to ship this darknet on another system so that I can run train commands there with appropriate initial weights file, cfg file and data as per the format. Which all files do I need to copy for the same? Do i have to set any environment variables? If yes, what are they and which supporting libraries would i need?

Also waiting for a tensorflow wrapper that works just like the original darknet for training. So far everything that there is is shit!

Thanks for your efforts!

Wrong ! Shortcut layer in CSPdarknet-53

Hi Author

I had read your code but i realize shortcut layer don't have performs in your code
I read common config of author who create at
https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov4.cfg

and shortcut layer is a layer Adding previous layer with layers specified in from= parameter

you can see https://github.com/AlexeyAB/darknet/wiki/CFG-Parameters-in-the-different-layers

That so
Sorry if I have wrong but i confuse when i read your code although is perfect
Thai Hoc

Training issues

Hello, i am running your code on Colab.

  • My issue is that i am getting nan values in the training process.

image

  • I want also to know how do you define the logs keys, because i want to show the obj_loss and class_loss values in callbacks, but i cant find a way to do it.

Thank you.

mAP

Is there any way that we can use mAP in training as metric in this notebook? Could anyone please provide some insights about how one can one implement mAP in TensorFlow as a metric

How to use

Hello Thanks for your work. I was looking for this for a long time.
but I'm a little confused in read me.
I want to train yolo with traffic signs dataset and deploy that on mobile using tensorflow lite.
My question is can i use your YoloV4_Train_tf.ipynb file for my dataset?
What format dataset should have and where I must point to my dataset? in # Build the labels files for VOC train dataset section??
And I dont know in witch section the train process begins.
the first cell runs with below error.
ImportError: cannot import name 'get_custom_objects' from 'keras.utils' (/usr/local/lib/python3.7/dist-packages/keras/utils/init.py)

you can help me very much and i appreciate that.

Training

How do I train with pascal voc?

ValueError: Cannot reshape a tensor with 2945760 elements to shape [2,76,76,3,36] (1247616 elements)

When training the model from scratch with 608x608 images i get the following error:

ValueError: Cannot reshape a tensor with 2945760 elements to shape [2,76,76,3,36] (1247616 elements) for '{{node custom_loss/Reshape_1}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32](Yolo_v4/BN_138/FusedBatchNormV3, custom_loss/Reshape_1/shape)' with input shapes: [2,76,76,255], [5] and with input tensors computed as partial shapes: input[1] = [2,76,76,3,36].

I am not sure where it goes wrong, could you help me please?
Thank you!

Requirements

Hello,

nice implementation, unfortunately, I can't let it run due to module installations.
I Installed following packages as suggested.

keras == 2.2.4
tensorflow-gpu == 2.1.0

and
get_custom_objects().update({'mish': Mish(mish)})
throws the
AttributeError: module 'tensorflow' has no attribute 'get_default_graph
error.

is there a requirements.txt?

Any help appreciated.

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.