tsycnh / keras-tutorials Goto Github PK
View Code? Open in Web Editor NEW一个面向初学者的,友好的Keras入门教程
一个面向初学者的,友好的Keras入门教程
十分感谢 @tsycnh 做出详细易懂的教程。
在运行class_6.ipynb
的时候我遇到了如下error:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/keras/utils/data_utils.py", line 578, in get
inputs = self.queue.get(block=True).get()
File "/usr/lib64/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
File "/usr/lib64/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/usr/lib64/python3.6/site-packages/keras/utils/data_utils.py", line 401, in get_index
return _SHARED_SEQUENCES[uid][i]
File "/usr/lib64/python3.6/site-packages/keras/preprocessing/image.py", line 825, in __getitem__
return self._get_batches_of_transformed_samples(index_array)
File "/usr/lib64/python3.6/site-packages/keras/preprocessing/image.py", line 1233, in _get_batches_of_transformed_samples
img = self.image_data_generator.preprocessing_function(img)
File "/usr/lib64/python3.6/site-packages/keras/applications/inception_v3.py", line 407, in preprocess_input
return imagenet_utils.preprocess_input(x, mode='tf')
File "/usr/lib64/python3.6/site-packages/keras/applications/imagenet_utils.py", line 178, in preprocess_input
mode=mode)
File "/usr/lib64/python3.6/site-packages/keras/applications/imagenet_utils.py", line 115, in _preprocess_symbolic_input
x /= 127.5
TypeError: unsupported operand type(s) for /=: 'JpegImageFile' and 'float'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test_train.py", line 68, in <module>
class_weight='auto'
File "/usr/lib64/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/usr/lib64/python3.6/site-packages/keras/engine/training.py", line 2192, in fit_generator
generator_output = next(output_generator)
File "/usr/lib64/python3.6/site-packages/keras/utils/data_utils.py", line 584, in get
six.raise_from(StopIteration(e), e)
File "<string>", line 3, in raise_from
StopIteration: unsupported operand type(s) for /=: 'JpegImageFile' and 'float'
Environment:
Pillow (5.0.0)
Keras (2.1.5)
numpy (1.13.3)
tensorflow-gpu (1.6.0)
Python 3.6.4
Nvidia driver: 387.26
CUDA 9.0
val_datagen = ImageDataGenerator(
preprocessing_function=preprocess_input,
rotation_range=30,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
)
i think val_datagen shouldn‘t use data augment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.