Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting issue with AirSim #12

Closed
edimoon777 opened this issue Mar 7, 2018 · 15 comments
Closed

Connecting issue with AirSim #12

edimoon777 opened this issue Mar 7, 2018 · 15 comments

Comments

@edimoon777
Copy link

edimoon777 commented Mar 7, 2018

I trained the model successfully and tried to run TestModel.ipynb.
but connection with Airsim is not works.

  1. I changed MODEL_PATH with trained model.
    MODEL_PATH = 'model/models/model_model.26-0.0002362.h5'
    -> Runs well.

  2. Run AD_Cookbook_Start_AirSim.ps1 using PowerShell.
    -> Runs well.

  3. No further process during connecting to AirSim.
    Waiting for connection:
    -> Not works.

I've already tested examples of CNTK-AirSim (Drone, Car) and it works well in my laptop.
Test Environments
OS : Windows 10 64bit.
GPU : GTX1060 6GB
Anaconda3

@adshar
Copy link
Collaborator

adshar commented Mar 7, 2018

Did you make sure AirSim was running in a separate window before trying to connect to it?

@edimoon777
Copy link
Author

edimoon777 commented Mar 7, 2018 via email

@mitchellspryn
Copy link
Contributor

mitchellspryn commented Mar 8, 2018

  1. Are you passing the 'landscape' argument to the ps script? It should be started with

.\AD_Cookbook_Start_AirSim.ps1 landscape -windowed

  1. What is the output of
    netstat -a
    You should see a TCP connection on port 42451. If it's not there, then AirSim didn't start correctly. If, for some reason AirSim is starting on a different port, then you'll need to modify AirsimClient.py to point to the correct port (inside the constructor for CarClient).

@edimoon777
Copy link
Author

I tried to run AirSim seperately with powershell and checked netstat.
but it does not connect to AirSim.

  1. Run AirSim in a seperated windows -> success.
  2. Checked TCP port -> normal
  3. Waiting for connection: -> no further progress

-----------Powershell------
PS C:\AD_Cookbook_AirSim\AD_Cookbook_AirSim> .\AD_Cookbook_Start_AirSim.ps1 landscape -windowed
Configuring AirSim for scenario landscape...
Creating configuration JSON for scenario landscape...
Attempting to write configuration json to C:\Users\Jungho\Documents\AirSim\settings.json...
Configuration json successfully written.
Starting AirSim for scenario landscape...
Executing C:\AD_Cookbook_AirSim\AD_Cookbook_AirSim\Landscape_Neighborhood\JustAssets.exe landscape -WINDOWED...
PS C:\AD_Cookbook_AirSim\AD_Cookbook_AirSim>

----------- netstat -a -----------
...
TCP 127.0.0.1:42451 DESKTOP-ONVOC78:51845 ESTABLISHED
...
TCP 127.0.0.1:51845 DESKTOP-ONVOC78:42451 ESTABLISHED

@mitchellspryn
Copy link
Contributor

Dumb question, but did you try running the rest of the cells? The cell should finish without any errors if the connection is successful. Usually, when a connection failure happens, a stack trace is printed. Is the cell freezing with the [*] forever, or does it get a number?

@edimoon777
Copy link
Author

The cell gets a number. but It prints "Waiting for connection:" and remained.
I'll check next steps ignoring this cell.

@mitchellspryn
Copy link
Contributor

If the cell gets a number (and doesn't print a big angry stack trace), then that means that it finished running and connected as expected. You can verify this by adding a print statement at the bottom of the cell.

@edimoon777
Copy link
Author

At the last cell, errors came as below.
It seems to be related to CUDA and cuDNN.


2018-03-12 23:02:16.754965: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\stream_executor\cuda\cuda_blas.cc:443] failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
2018-03-12 23:02:16.767295: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\stream_executor\cuda\cuda_blas.cc:443] failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
2018-03-12 23:02:16.777790: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\stream_executor\cuda\cuda_blas.cc:443] failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
2018-03-12 23:02:18.146084: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\stream_executor\cuda\cuda_dnn.cc:385] could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
2018-03-12 23:02:18.156164: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\stream_executor\cuda\cuda_dnn.cc:352] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
2018-03-12 23:02:18.166822: F C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\35\tensorflow\core\kernels\conv_ops.cc:717] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(), &algorithms)

@shrimalmadhur
Copy link

shrimalmadhur commented Mar 15, 2018

@edimoon777 Looks like a similar issue which has been discussed here. There are some solutions mentioned there. Can you try those?

@mitchellspryn
Copy link
Contributor

Is this issue solved?

@edimoon777
Copy link
Author

edimoon777 commented Mar 19, 2018 via email

@mitchellspryn
Copy link
Contributor

Ok.

I have CUDA 9.1 and CuDNN 7.1.1.

@edimoon777
Copy link
Author

Thank you everybody. I solved this issue.
"waiting for connection" message remains even when the connection is normal.
so I suggest you to add a message such as 'Connection successful' if it's connected. (It is confusing)

I wrote a new issue that I fixed about GPU memory errors.

@NotAnyMike
Copy link

Based on this, the problem of failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED and Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED is because tf is using all GPU memory, you can avoid it by allocating memory dynamically, the following code will make tf use only the memory it needs

import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True  # dynamically grow the memory used on the GPU

sess = tf.Session(config=config)
set_session(sess)  # set this TensorFlow session as the default session for Keras

That solved the problem for me

@yosra5
Copy link

yosra5 commented May 31, 2019

whene i running tensorflow-gpu with airsim i haved this error :
ValueError: cannot reshape array of size 1 into shape (0,0)
how can i solve it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants