naokishibuya / car-behavioral-cloning

Built and trained a convolutional network for end-to-end driving in a simulator using Tensorflow and Keras
MIT License
229 stars 136 forks source link

model.py giving error for training on new data #3

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi naokishibuya!!

Sir when i am trying to train the model for my newly created data using this command

python model.py i am getting the below error Please suggest me where i am wrong

I am using Ubuntu 16.04 and the data folder is in my home directory (containing file driving_log.csv and IMG folder) and my model.py is also in my home directory.Rest everything is working fine for pre-trained data.


Using TensorFlow backend.
------------------------------
Parameters
------------------------------
data_dir             := data
samples_per_epoch    := 20000
nb_epoch             := 10
learning_rate        := 0.0001
save_best_only       := True
test_size            := 0.2
keep_prob            := 0.5
batch_size           := 40
------------------------------
Traceback (most recent call last):
  File "model.py", line 162, in <module>
    main()
  File "model.py", line 154, in main
    data = load_data(args)
  File "model.py", line 33, in load_data
    X = data_df[['center', 'left', 'right']].values
  File "/home/vinayak/miniconda3/envs/car-behavioral-cloning/lib/python3.5/site-packages/pandas/core/frame.py", line 2056, in __getitem__
    return self._getitem_array(key)
  File "/home/vinayak/miniconda3/envs/car-behavioral-cloning/lib/python3.5/site-packages/pandas/core/frame.py", line 2100, in _getitem_array
    indexer = self.loc._convert_to_indexer(key, axis=1)
  File "/home/vinayak/miniconda3/envs/car-behavioral-cloning/lib/python3.5/site-packages/pandas/core/indexing.py", line 1231, in _convert_to_indexer
    raise KeyError('%s not in index' % objarr[mask])
KeyError: "['center' 'left' 'right'] not in index"
naokishibuya commented 7 years ago

Hi @DOCOPAC,

This might be due to the header row (column names) missing in the newly created driving_log.csv file.

The first line of the driving_log.csv should have the column names as follows.

center,left,right,steering,throttle,brake,speed
IMG/center_2016_12_01_13_30_48_287.jpg, IMG/left_2016_12_01_13_30_48_287.jpg, IMG/right_2016_12_01_13_30_48_287.jpg, 0, 0, 0, 22.14829
IMG/center_2016_12_01_13_30_48_404.jpg, IMG/left_2016_12_01_13_30_48_404.jpg, IMG/right_2016_12_01_13_30_48_404.jpg, 0, 0, 0, 21.87963
...

You may also want to check out the issue #2 which is probably related.

Let me know how it goes. We can continue to discuss how to solve the issue together.

naokishibuya commented 7 years ago

Hi @DOCOPAC,

I'm closing this issue as I haven't heard from you for some time. Please reopen the issue if you're still having related issues.