[PYTHON] I got a TypeError:'int' object is not iterable when using keras

Error

TypeError: 'int' object is not iterable

Applicable source code

model.add(self.conv_2d(64, input_shape=self.input_shape, name='block1_conv1'))

Cause

I was passing an integer where I had to pass it as a tuple to input_shape

Code that does not make an error

model.add(self.conv_2d(64, input_shape=(self.image_size, self.image_size, self.channel), name='block1_conv1'))

in conclusion

Let's see the reference properly.

reference

Conv2D layer

Recommended Posts

I got a TypeError:'int' object is not iterable when using keras
TypeError:'int' object is not subscriptable
I got a Value Error when using JUMAN ++ with PyKNP
[Django error]'RenameAttributes' object is not iterable
What I got into when using Tensorflow-gpu
Linux Ubuntu16.04 I got a little scary error when I ran a command using sudo
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
I got a UnicodeDecodeError when pip install on ubuntu
There is a pattern that the program did not stop when using Python threading
I got a sqlite3.OperationalError
I got an error when using Tensorboard with Pytorch
I got "ModuleNotFoundError: No module named'azure'" when running a program using Azure SDK for Python
When creating a pipenv environment, I got addicted to "Value Error: Not a valid python path"
When using property, use a class that inherits object (new-style class)
Python list is not a list
Sequential processing method when there is not enough memory in Keras
A story that I fixed when I got Lambda logs from Cloudwatch Logs
[Python] Appears when using iterdir () etc. [Errno 20] Not a directory:'*** / .DS_Store'
When I try to use pip, SSL module is not available.
[Django] Error when using Q object (Related Field got invalid lookup)
I get a can't set attribute when using @property in python
What I stumbled upon when using CodeIgniter on a Linux server
I want to display the number of num_boost_rounds when early_stopping is applied using XGBoost callback (not achieved)
I made a Line-bot using Python!
A note when gcloud is broken
Check points when MIDI does not work in a program using SDL_mixer
A reminder of what I got stuck when starting Atcoder with python
[Web server] A story when I investigated because I could not access nginx
When I try to go back using chainer, it fits a little
Bug that says'val_loss' is not found when using Early Stopping in pytorch-lightning (0.5.3.2)