Coder Social home page Coder Social logo

reflex_behaviour's Introduction

Reflex behaviour

Overview

This is an updated version of the repo https://github.com/naokishibuya/car-behavioral-cloning from naokishibuya which uses Pytorch instead of Keras.

Dependencies

You can install all dependencies by running one of the following commands

You need a anaconda or miniconda to use the environment setting.

conda env create -f environments.yml

Usage

Start the simulator

Start up the Udacity self-driving simulator, choose a scene and press the Training Mode. Then, collect the images for training.

Train the model

To train the model, call the following script:

python train.py -d <data directory>

There are more arguments you can specify and you can see them all by calling:

python train.py -h

Test the model

All the models that will be created will be within the models directory which is created during training.

Test one of the models by running the the script:

python drive.py <path to model_weights>

#Example
python drive.py models/model_50000

You also need to run car simulator in unity in test mode.

Tips for training and inference

If you are stuck with a low end computer it's best to run the unity simulator with the lowest resolution. This will make it easier for the unity simulator to apply the steering commands in time before the car will be in another position. This happens since it's an asynchronous client/server relationship between the unity simulator and the ML model.

I collected data by driving around the lake track for 5 rounds. The model_50000, which you can find in the model folder, oversteers a bit but it stays within the track.

Feel free to leave an issue if you're having any problems :-)

Credits

Credits to naokishibuya and to the paper 'End to End Learning for Self-Driving Cars' from Bojarski et al.

reflex_behaviour's People

Contributors

mathiashaudgaard avatar

Stargazers

Chandan K P avatar Casper Laursen avatar Anukriti Singh avatar  avatar Taraburca Radu avatar Abhishek Chatterjee avatar Seungwoo Han avatar

Watchers

James Cloos avatar  avatar Taraburca Radu avatar

reflex_behaviour's Issues

cv2 Error

In program train.py I have error in line number 41 (img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) the error says :
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-1syr35c1/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
The line before this in the code is img = cv2.imread(data[img_pth]) When I try to print(data[img_pth]) I see correct path getting printed but ehn I print(img) after this line I get none
Can you please help me solve this problem?

Can't connect

I have created the environment as in descriprion.
I have run the "python drive.py models/model_50000" comand in Anaconda Prompt.
image
After this nothing is happening. I did not receive a connected message.
I tried using both Version 2 and Version 1 simulator from Term 1 from the audacity git repo(https://github.com/udacity/self-driving-car-sim).
Can you help me find what is going on ?

Can't connect

Hi Mathias,

My Terminal keeps getting stuck at this point and nothing moves further:
'''
(sd_car) n@n-MacBook-Pro reflex_behaviour-master % python drive.py models/model_50000
NOT RECORDING THIS RUN ...
(66957) wsgi starting up on http://0.0.0.0:4567
'''
What could be the issue?
I have the correct version of socket and have installed everything in your environment file.
I have the simulator set to autonomous mode

Many thanks for your help

Screenshot 2021-08-02 at 8 55 50 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.