-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The input must have 3 channels, I need 1 channel #147
Comments
You can add a convolutional layer with feature maps 3 with pad size 3 (same) to match with the imagenet weights. |
This issue is not related to the package itself, so I suggest to close it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running following code
base_model = efn.EfficientNetB0(include_top=False, weights='imagenet', input_shape=(256,256,1))
I get
Traceback (most recent call last):
File "models/discriminator.py", line 40, in
model = discriminator((256,256,1))
File "models/discriminator.py", line 19, in discriminator
base_model.input = layers.Input(input_shape)
File "/home/mbarakat/anaconda3/envs/tf1/lib/python3.6/site-packages/keras/engine/network.py", line 323, in setattr
super(Network, self).setattr(name, value)
File "/home/mbarakat/anaconda3/envs/tf1/lib/python3.6/site-packages/keras/engine/base_layer.py", line 1245, in setattr
super(Layer, self).setattr(name, value)
AttributeError: can't set attribute
(tf1) mbarakat@ml-server2:~/gan$ python models/discriminator.py
Using TensorFlow backend.
Traceback (most recent call last):
File "models/discriminator.py", line 40, in
model = discriminator((256,256,1))
File "models/discriminator.py", line 11, in discriminator
base_model = efn.EfficientNetB0(include_top=False, weights='imagenet', input_shape=input_shape)
File "/home/mbarakat/anaconda3/envs/tf1/lib/python3.6/site-packages/efficientnet/init.py", line 44, in wrapper
return func(*args, **kwargs)
File "/home/mbarakat/anaconda3/envs/tf1/lib/python3.6/site-packages/efficientnet/model.py", line 477, in EfficientNetB0
**kwargs
File "/home/mbarakat/anaconda3/envs/tf1/lib/python3.6/site-packages/efficientnet/model.py", line 326, in EfficientNet
weights=weights)
File "/home/mbarakat/anaconda3/envs/tf1/lib/python3.6/site-packages/keras_applications/imagenet_utils.py", line 316, in _obtain_input_shape
'
input_shape=' + str(input_shape) + '
')ValueError: The input must have 3 channels; got
input_shape=(256, 256, 1)
The text was updated successfully, but these errors were encountered: