Code Monkey home page Code Monkey logo

Comments (17)

nikola-j avatar nikola-j commented on July 20, 2024 4

I've fixed it by renaming the "compute_overlap.cython-36m-x86_64-linux-gnu.so" to "compute_overlap.so"

from efficientdet.

xuannianz avatar xuannianz commented on July 20, 2024 2

@nikola-j Do it really work on Windows?
@HaiLongEmb How about running python setup.py build_ext --inplace to rebuild the module?

from efficientdet.

xuannianz avatar xuannianz commented on July 20, 2024

Hi @nicholasguimaraes , could you replace the compute_overlap.so of this repo with the one from keras-retinanet?
If it still does not work, try to rebuild it by running the setup.py script from keras-retinanet.
Wait for your feedback.

from efficientdet.

nicholasguimaraes avatar nicholasguimaraes commented on July 20, 2024

Thank you for your reply.

In fact I don't have a compute_overlap.so file under keras-retinanet/utils.

I do have a compute_overlap.c , .pyd and .pyx.

I tried replacing the compute_overlap.pyx from EfficientDet/utils with the .pyx from RetinaNet/utils and I was able to start training but, I got an AssertionError after the first step.

"""

File "train.py", line 352, in
main()
File "train.py", line 347, in main
validation_data=validation_generator
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1433, in fit_generator
steps_name='steps_per_epoch')
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 220, in model_iteration
batch_data = _get_next_batch(generator, mode)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 362, in _get_next_batch
generator_output = next(generator)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 785, in get
six.reraise(*sys.exc_info())
File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\six.py", line 693, in reraise
raise value
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 779, in get
inputs = self.queue.get(block=True).get()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\multiprocessing\pool.py", line 644, in get
raise self._value
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 571, in get_index
return _SHARED_SEQUENCES[uid][i]
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 400, in getitem
inputs, targets = self.compute_inputs_targets(group)
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 369, in compute_inputs_targets
image_group, annotations_group = self.random_misc_group(image_group, annotations_group)
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 278, in random_misc_group
annotations_group[index])
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 257, in random_misc_group_entry
assert annotations['bboxes'].shape[0] != 0
AssertionError

"""

from efficientdet.

HaiLongEmb avatar HaiLongEmb commented on July 20, 2024

How to solve the same problem on Windows @xuannianz
222

from efficientdet.

nikola-j avatar nikola-j commented on July 20, 2024

@xuannianz I'm on ubuntu 18.04

from efficientdet.

nicholasguimaraes avatar nicholasguimaraes commented on July 20, 2024

Hello @xuannianz , I am also on Windows.

After running "python setup.py build_ext --inplace" I got the file "compute_overlap.cp36-win_amd64.pyd" which I renamed to "compute_overlap.pyd". I added the .pyd from retinanet/utils to efficientdet/utils and I was able to start training but soon I get another Error.

"""

Traceback (most recent call last):
File "train.py", line 352, in
main()
File "train.py", line 347, in main
validation_data=validation_generator
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1433, in fit_generator
steps_name='steps_per_epoch')
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 293, in model_iteration
callbacks._call_batch_hook(mode, 'end', step, batch_logs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\callbacks.py", line 248, in _call_batch_hook
batch_hook(batch, logs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\callbacks.py", line 531, in on_train_batch_end
self.on_batch_end(batch, logs=logs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\callbacks_v1.py", line 362, in on_batch_end
profiler.save(self.log_dir, profiler.stop())
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\eager\profiler.py", line 144, in save
gfile.MakeDirs(plugin_dir)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 438, in recursive_create_dir
recursive_create_dir_v2(dirname)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 453, in recursive_create_dir_v2
pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(path))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: logs/2019-12-05\plugins\profile\2019-12-05_14-18-11; No such file or directory

"""

Has anyone gotten the same error?

from efficientdet.

nicholasguimaraes avatar nicholasguimaraes commented on July 20, 2024

random_misc_group_entry
assert annotations['bboxes'].shape[0] != 0
AssertionError

Regarding the AssertionError I got a few days ago, it happened because I tried using background images with no x1,y1,x2,y2

from efficientdet.

xuannianz avatar xuannianz commented on July 20, 2024

@nicholasguimaraes You can pull the latest code in which I removed that assertion.

from efficientdet.

nicholasguimaraes avatar nicholasguimaraes commented on July 20, 2024

@nicholasguimaraes You can pull the latest code in which I removed that assertion.

I just pulled the latest code.

It seems that I cannot train without validation data.

"""
Traceback (most recent call last):
File "train.py", line 355, in
main()
File "train.py", line 350, in main
validation_data=validation_generator
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1433, in fit_generator
steps_name='steps_per_epoch')
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 220, in model_iteration
batch_data = _get_next_batch(generator, mode)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\engine\training_generator.py", line 362, in _get_next_batch
generator_output = next(generator)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 785, in get
six.reraise(*sys.exc_info())
File "C:\Users\Windows\AppData\Roaming\Python\Python36\site-packages\six.py", line 693, in reraise
raise value
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 779, in get
inputs = self.queue.get(block=True).get()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\multiprocessing\pool.py", line 644, in get
raise self._value
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\tensorflow\python\keras\utils\data_utils.py", line 571, in get_index
return SHARED_SEQUENCES[uid][i]
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 392, in getitem
inputs, targets = self.compute_inputs_targets(group)
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 348, in compute_inputs_targets
image_group = self.load_image_group(group)
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 219, in load_image_group
return [self.load_image(image_index) for image_index in group]
File "C:\Users\Windows\Documents\EfficientDet\generators\common.py", line 219, in
return [self.load_image(image_index) for image_index in group]
File "C:\Users\Windows\Documents\EfficientDet\generators\csv
.py", line 225, in load_image
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

"""

I'm not passing compute_val_loss as an argument.

This is my line to start training:

python train.py --phi 0 --freeze-backbone csv bin/csv_label/annotations.csv bin/csv_label/classes.csv

from efficientdet.

xuannianz avatar xuannianz commented on July 20, 2024

Check the image paths in your csv file.

from efficientdet.

nicholasguimaraes avatar nicholasguimaraes commented on July 20, 2024

Check the image paths in your csv file.

The image path is correct. I wonder if using .gif images could be the problem.

I use the same dataset to train retinanet and we works fine.

from efficientdet.

nicholasguimaraes avatar nicholasguimaraes commented on July 20, 2024

I fixed it!

On generators/csv_.py I updated the function load_image to load images with PIL instead of cv2, but that was not the solution.

I had to go to
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Lib\site-packages\tensorflow\python\lib\io

and update file_io.py , more specifically the function recursive_create_dir_v2.

that's what it looks now:

def recursive_create_dir_v2(path):
#print(path)
dest_log = "C:\...\EfficientDet\logs\"
path_new = path.replace("logs/","")
path_new = path_new.replace(chr(92), "\")
path = dest_log+path_new

Turns out it was simply a path error. I hope this can help all windows users.

from efficientdet.

stale avatar stale commented on July 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from efficientdet.

gabriel-zly avatar gabriel-zly commented on July 20, 2024

@noahtren
Sorry, I didn’t see the file set.py in the code. Could you send me this? Thank you!

from efficientdet.

kumbarisagar avatar kumbarisagar commented on July 20, 2024

when i run a inference.py i am getting a error as no module named compute_overlap
what to do? when we encounter this in inference.py

from efficientdet.

kumbarisagar avatar kumbarisagar commented on July 20, 2024

please reply back i need urgent reply

from efficientdet.

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.