xuannianz / EfficientDet

EfficientDet (Scalable and Efficient Object Detection) implementation in Keras and Tensorflow
Apache License 2.0
1.4k stars 395 forks source link

Custom Dataset Training not starting #251

Closed VAIBHAVPATEL97 closed 3 years ago

VAIBHAVPATEL97 commented 3 years ago

Hello, I am trying to start the training for the custom dataset. But, I am getting the following ValueError. I am not able to figure out a way to solve it. Any leads to solve this. Thanks in advance.

(efficientdet) project@system :~/Desktop/EfficientDet$ python3 train.py --snapshot imagenet --phi 0 --gpu 0 --random-transform --compute-val-loss --freeze-backbone --batch-size 32 --steps 1000 coco datasets/coco

2021-09-09 11:48:25.120558: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-09-09 11:48:25.120578: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2.6.0
{'dataset_type': 'coco', 'detect_quadrangle': False, 'detect_text': False, 'snapshot': 'imagenet', 'freeze_backbone': True, 'freeze_bn': False, 'weighted_bifpn': False, 'batch_size': 32, 'phi': 0, 'gpu': '0', 'epochs': 50, 'steps': 1000, 'snapshot_path': 'checkpoints/2021-09-09', 'tensorboard_dir': 'logs/2021-09-09', 'snapshots': True, 'evaluation': True, 'random_transform': True, 'compute_val_loss': True, 'multiprocessing': False, 'workers': 1, 'max_queue_size': 10, 'coco_path': 'datasets/coco'}
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
Traceback (most recent call last):
  File "/home/project/Desktop/EfficientDet/train.py", line 381, in <module>
    main()
  File "/home/project/Desktop/EfficientDet/train.py", line 313, in main
    model, prediction_model = efficientdet(args.phi,
  File "/home/project/Desktop/EfficientDet/model.py", line 430, in efficientdet
    features = backbone_cls(input_tensor=image_input, freeze_bn=freeze_bn)
  File "/home/project/Desktop/EfficientDet/utils/__init__.py", line 58, in wrapper
    return func(*args, **kwargs)
  File "/home/project/Desktop/EfficientDet/efficientnet.py", line 461, in EfficientNetB0
    return EfficientNet(1.0, 1.0, 224, 0.2,
  File "/home/project/Desktop/EfficientDet/efficientnet.py", line 388, in EfficientNet
    if not is_keras_tensor(input_tensor):
  File "/home/project/anaconda3/envs/efficientdet/lib/python3.9/site-packages/tensorflow/python/keras/backend.py", line 1281, in is_keras_tensor
    raise ValueError('Unexpectedly found an instance of type `' + str(type(x)) +
stale[bot] commented 3 years ago

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.

Aryanjb commented 1 year ago

Hello, I am trying to start the training for the custom dataset. But, I am getting the following ValueError. I am not able to figure out a way to solve it. Any leads to solve this. Thanks in advance.

(efficientdet) project@system :~/Desktop/EfficientDet$ python3 train.py --snapshot imagenet --phi 0 --gpu 0 --random-transform --compute-val-loss --freeze-backbone --batch-size 32 --steps 1000 coco datasets/coco

2021-09-09 11:48:25.120558: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-09-09 11:48:25.120578: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2.6.0
{'dataset_type': 'coco', 'detect_quadrangle': False, 'detect_text': False, 'snapshot': 'imagenet', 'freeze_backbone': True, 'freeze_bn': False, 'weighted_bifpn': False, 'batch_size': 32, 'phi': 0, 'gpu': '0', 'epochs': 50, 'steps': 1000, 'snapshot_path': 'checkpoints/2021-09-09', 'tensorboard_dir': 'logs/2021-09-09', 'snapshots': True, 'evaluation': True, 'random_transform': True, 'compute_val_loss': True, 'multiprocessing': False, 'workers': 1, 'max_queue_size': 10, 'coco_path': 'datasets/coco'}
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
Traceback (most recent call last):
  File "/home/project/Desktop/EfficientDet/train.py", line 381, in <module>
    main()
  File "/home/project/Desktop/EfficientDet/train.py", line 313, in main
    model, prediction_model = efficientdet(args.phi,
  File "/home/project/Desktop/EfficientDet/model.py", line 430, in efficientdet
    features = backbone_cls(input_tensor=image_input, freeze_bn=freeze_bn)
  File "/home/project/Desktop/EfficientDet/utils/__init__.py", line 58, in wrapper
    return func(*args, **kwargs)
  File "/home/project/Desktop/EfficientDet/efficientnet.py", line 461, in EfficientNetB0
    return EfficientNet(1.0, 1.0, 224, 0.2,
  File "/home/project/Desktop/EfficientDet/efficientnet.py", line 388, in EfficientNet
    if not is_keras_tensor(input_tensor):
  File "/home/project/anaconda3/envs/efficientdet/lib/python3.9/site-packages/tensorflow/python/keras/backend.py", line 1281, in is_keras_tensor
    raise ValueError('Unexpectedly found an instance of type `' + str(type(x)) +

Hi Vaibhav, did you manage to solve it? I'm also trying to train the model on a custom dataset but facing some issues. Could you please let me know how you proceeded. Thanks in advance