llSourcell / How_to_simulate_a_self_driving_car

This is the code for "How to Simulate a Self-Driving Car" by Siraj Raval on Youtube
431 stars 306 forks source link

pretrained model not working #4

Open milyasyousuf opened 7 years ago

milyasyousuf commented 7 years ago

Hi Siraj,

I am trying to run your pretrained model on my system. But unlucky I am getting these error, Can you please help me? python drive.py model.h5 Using TensorFlow backend. Traceback (most recent call last): File "drive.py", line 124, in <module> model = load_model(args.model) File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 240, in load_model model = model_from_config(model_config, custom_objects=custom_objects) File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 304, in model_from_config return layer_module.deserialize(config, custom_objects=custom_objects) File "/usr/local/lib/python2.7/dist-packages/keras/layers/__init__.py", line 54, in deserialize printable_module_name='layer') File "/usr/local/lib/python2.7/dist-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object list(custom_objects.items()))) File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 1202, in from_config layer = layer_module.deserialize(conf, custom_objects=custom_objects) File "/usr/local/lib/python2.7/dist-packages/keras/layers/__init__.py", line 54, in deserialize printable_module_name='layer') File "/usr/local/lib/python2.7/dist-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object list(custom_objects.items()))) File "/usr/local/lib/python2.7/dist-packages/keras/layers/core.py", line 706, in from_config function = func_load(config['function'], globs=globs) File "/usr/local/lib/python2.7/dist-packages/keras/utils/generic_utils.py", line 198, in func_load code = marshal.loads(code.encode('raw_unicode_escape')) ValueError: bad marshal data (unknown type code)

I am using python 2.7 and manual installation.

mabirck commented 7 years ago

Same in here!

rahulmanuwas commented 7 years ago

You should look at the dependencies in the environments.yml file. It will help.

Ilovescienceandpython commented 7 years ago

I think its python 3.5.x only preferebly python 3.5.2

duzumich commented 7 years ago

I used python 3.6 and pip to install these dependencies in the environments.yml file, it has the similar problem on pre-trained model. Does anyone get solved? Thanks.

rahulmanuwas commented 7 years ago

@duzumich use Python 3.5.2

duzumich commented 7 years ago

@rahulmanuwas Thank you for replying. I also tried the pre-trained model on Python 3.5.2, but it went out of the track at the beginning, did you meet with the problem or make any other changes on the training or testing model?

rahulmanuwas commented 7 years ago

@duzumich if you are following the dependencies from here, you need to open up your terminal and activate the conda environment via source activate car-behavioral-cloning if you are using linux. Then open Udacity self-driving simulator. Then cd to the cloned repo with the same terminal you used to to run the command source activate car-behavioral-cloning and once you are there, just run python drive.py model.h5