Sentdex / pygta5

Explorations of Using Python to play Grand Theft Auto 5.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: Cannot feed value of shape (64, 4) for Tensor 'targets/Y:0', which has shape '(?, 3)'

berkerogluu opened this issue · comments

Run id: pygta5-car-fast-0.001-alexnetv2-5-epochs-300K-data.model
Log directory: log/
---------------------------------
Training samples: 2950
Validation samples: 50
--
Traceback (most recent call last):
  File "C:\Users\robot\Desktop\tutorial\Part 8-13 code\train_model.py", line 25, in <module>
    model.fit( X, Y, n_epoch=1,validation_set=(test_x,test_y),snapshot_step=10, show_metric=True, run_id=MODEL_NAME)
  File "C:\Python36\lib\site-packages\tflearn\models\dnn.py", line 216, in fit
    callbacks=callbacks)
  File "C:\Python36\lib\site-packages\tflearn\helpers\trainer.py", line 339, in fit
    show_metric)
  File "C:\Python36\lib\site-packages\tflearn\helpers\trainer.py", line 818, in _train
    feed_batch)
  File "C:\Python36\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
    run_metadata_ptr)
  File "C:\Python36\lib\site-packages\tensorflow_core\python\client\session.py", line 1156, in _run
    (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (64, 4) for Tensor 'targets/Y:0', which has shape '(?, 3)'

Is anyone facing with same issue. All i did is copy/paste and could not find a proper solution to fix that on google

Well this is a shape error. The model is expecting a shape with 3 on the y, but what you're feeding in has a shape of 4 on the y, which is causing the error.

This repo is also pretty old, so it has a lotta bugs, I would recommend maybe using something similar to how sentdex gets his data, but definitely changing the model.