question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem to train densenet and mobilenet models

See original GitHub issue

When I use any model of resnet or vgg I have no problem, but when I try to test the densenet or mobilenet models the following problems arise:

keras-retinanet/keras_retinanet/bin/train.py --backbone=densenet201 --epochs=1 --steps=1 --no-weights coco /home/manuelvazquezenriquez2/keras-retinanet-test-data/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!
Creating model, this may take a second...
Traceback (most recent call last):
  File "keras-retinanet/keras_retinanet/bin/train.py", line 493, in <module>
    main()
  File "keras-retinanet/keras_retinanet/bin/train.py", line 461, in main
    config=args.config
  File "keras-retinanet/keras_retinanet/bin/train.py", line 118, in create_models
    model          = model_with_weights(backbone_retinanet(num_classes, num_anchors=num_anchors, modifier=modifier), weights=weights, skip_mismatch=True)
  File "keras-retinanet/keras_retinanet/bin/../../keras_retinanet/models/densenet.py", line 35, in retinanet
    return densenet_retinanet(*args, backbone=self.backbone, **kwargs)
  File "keras-retinanet/keras_retinanet/bin/../../keras_retinanet/models/densenet.py", line 85, in densenet_retinanet
    backbone = densenet.DenseNet(blocks=blocks, input_tensor=inputs, include_top=False, pooling=None, weights=None)
  File "/home/manuelvazquezenriquez2/.local/lib/python2.7/site-packages/keras_applications/densenet.py", line 193, in DenseNet
    data_format=backend.image_data_format(),
AttributeError: 'NoneType' object has no attribute 'image_data_format'

keras-retinanet/keras_retinanet/bin/train.py --backbone=mobilenet128 --epochs=1 --steps=1 --no-weights coco /home/manuelvazquezenriquez2/keras-retinanet-test-data/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!
Creating model, this may take a second...
Traceback (most recent call last):
  File "keras-retinanet/keras_retinanet/bin/train.py", line 493, in <module>
    main()
  File "keras-retinanet/keras_retinanet/bin/train.py", line 461, in main
    config=args.config
  File "keras-retinanet/keras_retinanet/bin/train.py", line 118, in create_models
    model          = model_with_weights(backbone_retinanet(num_classes, num_anchors=num_anchors, modifier=modifier), weights=weights, skip_mismatch=True)
  File "keras-retinanet/keras_retinanet/bin/../../keras_retinanet/models/mobilenet.py", line 35, in retinanet
    return mobilenet_retinanet(*args, backbone=self.backbone, **kwargs)
  File "keras-retinanet/keras_retinanet/bin/../../keras_retinanet/models/mobilenet.py", line 92, in mobilenet_retinanet
    alpha = float(backbone.split('_')[1])
IndexError: list index out of range

Any idea why it can be? Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
hgaisercommented, Oct 9, 2018

On second look, the error of mobilenet is because you’re missing the alpha in the backbone name.

It should be --backbone=mobilenet128_1.0 for an alpha of 1.0.

As for densenet, my original question still stands.

1reaction
hgaisercommented, Dec 7, 2018

Could you try updating keras-retinanet? I think I fixed that issue not so long ago. https://github.com/fizyr/keras-retinanet/commit/dca2d0d777a3a9daec5b2e98bcf76516eebe8887

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with training of mobilenet and densenet models #767
I have trained the the resnet models without any problem. But I got the following when I try to train the mobilenet or...
Read more >
A Novel Image Classification Approach via Dense ...
In Dense-MobileNet models, convolution layers with the same size of input feature maps in MobileNet models are taken as dense blocks, and dense...
Read more >
A bunch of tips and tricks for training deep neural networks
Training deep neural networks is difficult. It requires knowledge and experiences in order to properly train and obtain an optimal model.
Read more >
A comparative analysis of eleven neural networks ... - NCBI
An important problem with training neural networks on small datasets is that the trained models do not perform well on the validation and...
Read more >
Performance of Various Deep-Learning Networks in the ...
Training CNN-based deep learning models from scratch is a time-consuming process and requires a large data set. In some studies, models trained ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found