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.

Fail to create models with EfficientNetB*-backbone.

See original GitHub issue

I tried Unet with different some different backbones and had no problems until i tried variations of efficientnet.

I tried with both 0.2.* versions and 1.0.* versions.

Code:

import segmentation_models as sm

model = sm.Unet('efficientnetb0', 
                classes=4, 
                activation='sigmoid', 
                input_shape=(256, 256, 3), 
                encoder_weights='imagenet')

Error:

~\AppData\Local\Continuum\anaconda3\lib\site-packages\segmentation_models\utils.py in wrapper(*args, **kwargs)
     29                     kwargs[new_arg] = kwargs[old_arg]
     30 
---> 31             return func(*args, **kwargs)
     32 
     33         return wrapper

~\AppData\Local\Continuum\anaconda3\lib\site-packages\segmentation_models\unet\model.py in Unet(backbone_name, input_shape, classes, activation, encoder_weights, encoder_freeze, encoder_features, decoder_block_type, decoder_filters, decoder_use_batchnorm, **kwargs)
     61                             input_tensor=None,
     62                             weights=encoder_weights,
---> 63                             include_top=False)
     64 
     65     if encoder_features == 'default':

~\AppData\Local\Continuum\anaconda3\lib\site-packages\segmentation_models\backbones\__init__.py in get_backbone(name, *args, **kwargs)
     73 
     74 def get_backbone(name, *args, **kwargs):
---> 75     return Classifiers.get_classifier(name)(*args, **kwargs)
     76 
     77 

~\AppData\Local\Continuum\anaconda3\lib\site-packages\classification_models\__init__.py in get_classifier(cls, name)
     84     @classmethod
     85     def get_classifier(cls, name):
---> 86         return cls._models.get(name)[0]
     87 
     88     @classmethod

TypeError: 'NoneType' object is not subscriptable

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
simon-larssoncommented, Oct 1, 2019

I got it working with the 1* dependencies now. I think I previously got the error from not reloading my notebook kernel when switching from 0*.

I still cannot manage to get it working with 0*.

My versions:

Name: segmentation-models Version: 0.2.1

Name: image-classifiers Version: 0.2.0

Name: efficientnet Version: 0.0.4

However, I am happy to continue with 1* since it is working. So you can close this if this does not help you in any way. 😃

0reactions
gkaissiscommented, Oct 10, 2019

It’s not working with the pre-release versions for me. It creates trouble with segmentation_models (ImportError)…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use EfficientNet Lite models as backbone for keypoint ...
I would like to employ EfficientNet Lite 0 model as a backbone to perform a keypoint regression task. However, I get stuck at...
Read more >
Complete Architectural Details of all EfficientNet Models
Let's dive deep into the architectural details of all the different EfficientNet Models and find out how they differ from each other.
Read more >
ImageNet Benchmark (Image Classification) - Papers With Code
Rank Model Top 1 Accuracy Number of params Year 1 CoCa (finetuned) 91.0% 2100M 2022 2 Model soups (BASIC‑L) 90.98% 2440M 2022 3 Model soups (ViT‑G/14)...
Read more >
Model Zoo - Deep learning code and pretrained models for ...
ModelZoo curates and provides a platform for deep learning researchers to easily find code and pre-trained models for a variety of platforms and...
Read more >
Google Universal Image Embedding | Kaggle
I have a pre-trained model that uses efficientnet as backbone, ... also tried to modify the Model1 code to make it can be...
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