It is assumed that 3DCNN is implemented using keras to automatically classify videos.
The model is built with keras, and the generator is self-made.
The environment uses google colab.
After that, it was in a state to just learn, so when I started learning with fit_generator (), the following error statement appeared.
I don't know why the input was suddenly different on 6/165 even though I was already learning halfway.
Please give me some advice.
Applicable source code
6/165 [>.............................]-ETA: 7:57-loss: 16.1181-acc: 0.0000e + 00Traceback (most recent call last): File "main.py", line 64, in<module> epochs = 1) ... ... ... ValueError: Error when checking input: expected conv3d_1_input to have 5 dimensions, but got array with shape (8, 1)
validation_ratio = 0.3 num_sample = len (lists) sample_idxs = range (0, num_sample) sample_idxs = np.random.permutation (sample_idxs) train_sample_idx = sample_idxs [0: int ((1-validation_ratio) * num_sample)] valid_sample_idx = sample_idxs [int ((1-validation_ratio) * num_sample):] train_generator = video_generator.generate_train_from_directory (8, 'data', train_sample_idx) valid_generator = video_generator.generate_valid_from_directory (8, 'data', valid_sample_idx) model = C3d_model.get_model (summary = True) print ("Start learning") history = model.fit_generator (train_generator, steps_per_epoch = len (train_sample_idx)/8, epochs = 1) acc = model.evaluate_generator (valid_generator, steps = 10, verbos = 1) print ("loss:", acc ) print ("accuracy:", acc )
I tried to reduce the calculation load once by changing the batch size from 32 to 8.Supplemental information (FW/tool version etc.)
Please provide more detailed information here.
Answer # 1
Maybe one of the samples loaded in the 6th iteration does not match the shape of the model input?
The number of frames is different from the others, the size of the frames is different from the others, etc.
Answer # 2
The input of conv3d_1 needs to be five dimensions, but this time it is (8,1) Two-dimensional array? That ’s why it ’s not good.
It would be good to examine and improve the shape of the input data.
- machine learning - an error occurred in the feature calculation by the intermediate layer output of cnn
- python 3x - i want to fix the input value error that i got while streaming insert json data into bigquery
- python - an error has occurred in yolo v3
- i want to resolve a syntax error in a python while statement
- python - i want to display an image with pysimplegui, but an error occurs
- python - an error occurs in the if statement program that compares the size of numbers
- python - sklearn, svm error
- python - error in image binarization using cv2adaptivethreshold function
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- php - please tell me how to resolve the error that occurred while editing the wordpress theme
- python - categorical_crossentoropy error does not resolve
- readcsv error in python
- python - the py file cannot be executed in the task scheduler 0x2 error
- python - error when scraping with selenium and firefox
- indent error doesn't go away, python
- python - i get an error when connecting to a voice channel with discordpy
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- python - reinforcement learning of tag does not go well with open ai gym
- [python] i don't know how to solve the error
- python - idle cannot resolve the "rootgeometry" error
- python 3x - inflating table data using gan
- python 3x - i learned my own data with yolo-v3, but the recognition result is the same as before my own learning
- machine learning - is the gpu working properly?
- python - 'numpyndarray' object has no attribute'numpy' error
- python - 'numpyndarray' object has no attribute'append' error
- cross-validation in python
- python 3x - python keras
- python - how to reset the version of cudnn
- python - loss coefficient does not decrease at all | stock price forecast using deep learning
- python - in machine learning learning, the accuracy is 100% and the value of the loss function is almost 0 from the beginning an