Giter VIP home page Giter VIP logo

tfdetection's People

Contributors

burf 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

Watchers

 avatar  avatar  avatar  avatar

tfdetection's Issues

Training is extremely slow

Hi,
I am trying to train an object detection model on my own custom coco dataset (a json file) with about 80,000 300x300 images.
I am using the object_detection example (usage/train/object_detection.ipynb) the only differences are the data loading where I use tfdet.dataset.coco.load_pipe to load my data and the labels (I have 8 labels).
I am training on an NVIDIA RTX 2080 ti with Ryzen 9 5950X and an SSD.
During training my GPU memory is at 100% and the GPU itself is at an average of 80% usage.
a single epoch with this configuration takes more than 24 hours for reference training yolo-v7 from the official repo with the same data and machine takes around 6 minuets per around.
Is there something I am missing? are those normal training times?
Thanks.

Data preparing

Hello, may I ask if I do not want to change the code of data loading, do I have to prepare the data in the same format as COCO and YOLO?

Input shape for swin transformer backbone ?

Hi,

First, thanks for this work !
I got an error when a try to build a segmentation model using swin transformer as encoder :

x = tf.keras.layers.Input(shape = (224,224,3))  
feature = tfdet.model.backbone.swin_transformer_tiny_224_w7_1k(x, weights=None)  

I got AssertionError: input feature has wrong size.
It's the same with various shapes : (256,256,3), (224,224,1) ... etc

Maybe it's a silly question but I'm fairly new to transformers...
What should be input shape for swin backbones ? Or I missed an intermediate layer between input and swin ?

Error running efficient det lite d0 model on GPU

Hi,
I have trained an object detection model on my custom data using efficient det lite d0 architecture.
I have created a tflite model from a checkpoint using the export example.
The model trains fine according to tensorboard and I can run inferences just fine on my PC.
I want to run this model on an NPU so I quantized it to uint8 but when i try to run inference on the platform i get the following error:
RuntimeError: Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors.
From what i checked so far this error means there is a tensor with dynamic input somewhere in the graph.
I tried examining the model using netron but I couldn't find any dynamic operations.
Do you have any clue what this dynamic part might be?
Thanks.

Cannot save trained model to a saved_model

I am training with either effdet_d0 or yolo_v4 the train itself is OK but right after calling fit I try to save the model using model.save('temp/') but I get the following error: (using model.save_weights("model.h5") works fine)

Traceback (most recent call last):
File "/home/sergey/eff_det_open_source/TFDetection/usage/train.py", line 190, in
tf2trt(model, "converted_model.trt")
File "/home/sergey/eff_det_open_source/TFDetection/tfdet/export/tensorrt.py", line 28, in tf2trt
model.save(temp_path)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 205, in _deepcopy_list
append(deepcopy(a, memo))
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 296, in _reconstruct
value = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 264, in _reconstruct
y = func(*args)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 263, in
args = (deepcopy(arg, memo) for arg in args)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 205, in _deepcopy_list
append(deepcopy(a, memo))
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 205, in _deepcopy_list
append(deepcopy(a, memo))
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 205, in _deepcopy_list
append(deepcopy(a, memo))
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 205, in _deepcopy_list
append(deepcopy(a, memo))
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 205, in _deepcopy_list
append(deepcopy(a, memo))
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 153, in deepcopy
y = copier(memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 210, in
y = [deepcopy(a, memo) for a in x]
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/sergey/miniconda3/envs/old_tf_ver/lib/python3.8/copy.py", line 161, in deepcopy
rv = reductor(4)
TypeError: cannot pickle '_thread.RLock' object

convert to tflite

Hi,

Is it possible to convert effdet_lite to the tflite format? If yes, could you add a code sample?

Thanks

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.