AloshkaD / DroneTracking

1 stars 0 forks source link

did you finish the repo or not yet, causing I got error. #1

Open vxgu86 opened 5 years ago

vxgu86 commented 5 years ago

Loading existing training The RGB camera returned bad data so Im creating zero array to not break the training Traceback (most recent call last):

File "", line 1, in runfile('D:/RL/4DroneTracking-master/DQN-Train.py', wdir='D:/RL/DroneTracking-master')

File "D:\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile execfile(filename, namespace)

File "D:\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/RL/4DroneTracking-master/DQN-Train.py", line 155, in dqn.fit(env, callbacks=callbacks, nb_steps=250002, visualize=False, verbose=0, log_interval=5000)

File "D:\Anaconda3\lib\site-packages\rl\core.py", line 169, in fit action = self.forward(observation)

File "D:\Anaconda3\lib\site-packages\rl\agents\dqn.py", line 228, in forward q_values = self.compute_q_values(state)

File "D:\Anaconda3\lib\site-packages\rl\agents\dqn.py", line 69, in compute_q_values q_values = self.compute_batch_q_values([state]).flatten()

File "D:\Anaconda3\lib\site-packages\rl\agents\dqn.py", line 64, in compute_batch_q_values q_values = self.model.predict_on_batch(batch)

File "D:\Anaconda3\lib\site-packages\keras\engine\training.py", line 1268, in predict_onbatch x, , _ = self._standardize_user_data(x)

File "D:\Anaconda3\lib\site-packages\keras\engine\training.py", line 751, in _standardize_user_data exception_prefix='input')

File "D:\Anaconda3\lib\site-packages\keras\engine\training_utils.py", line 128, in standardize_input_data 'with shape ' + str(data_shape))

ValueError: Error when checking input: expected input_1 to have 4 dimensions, but got array with shape (1, 1, 90, 256, 3)

///////////////////////////////////////////////////////////////////////// in getScreenSceneVis()
img1d = np.array(bytearray(responses[0].image_data_uint8))#.reshape(responses[0].height, responses[0].width, 4) if len(img1d) != (1442564): ----->should this be 1442563?

I find the same code in your TrackGym also, what's the meaning?

vxgu86 commented 5 years ago

@AloshkaD sorry to bother

AloshkaD commented 5 years ago

This repo is deprecated and I'm going to push a new one with major upgrades. It's currently testing on my machines, so I can't tell exactly when will it be ready. Hopfully in a month.

vxgu86 commented 5 years ago

sorry for the bother the problem should be easy for you, and I am working on this right now We are getting a rgb image, it should be 1442563, why it's 4??

getScreenSceneVis() img1d = np.array(bytearray(responses[0].image_data_uint8))#.reshape(responses[0].height, responses[0].width, 4) if len(img1d) != (1442564): ----->should this be 1442563?

vxgu86 commented 5 years ago

and one question, are you using the visual studio as IDE?

AloshkaD commented 5 years ago

No, we are not getting RGB from airsim. The 4 channels are for RGB and gamma. I'm using Microsoft code as I develop on Linux.

vxgu86 commented 5 years ago

sorry but could you explain the detail of getScreenSceneVis, you are using simGetImages, it's from AirSim. by which way can I run your code up?

AloshkaD commented 5 years ago

no problem. I'm a bit busy these days as I'm preparing for graduation. I'll do my best to answer the questions that haven't been addressed on Airsim's repo. Since this method is from airsim, I highly recommend that you read airsim's api and the docs. There you can find detailed explanation for how to call rgb or depth images.

vxgu86 commented 5 years ago

sorry..... but I have red through the api docs include https://github.com/microsoft/AirSim/blob/master/docs/image_apis.md without finding anythin about the 4 channels of RGB and gamma

AloshkaD commented 5 years ago

I'm sorry. I meant to say Alph and not Gamma. My bad.So It's RGBA. Check out this https://github.com/microsoft/AirSim/issues/1557

vxgu86 commented 5 years ago

this is great, thanks but my return of img1d = np.array(bytearray(responses[0].image_data_uint8)) len(img1d) equals 144x256x3, why it's not 4 channels?

should I reshape it like in https://github.com/microsoft/AirSim/issues/1557 as follows: img4d_rgba = img1d_rgba.reshape(512, 512, 4) img3d_rbg = img4d_rgba[:, :, :3]

AloshkaD commented 5 years ago

Best thing to do is to plot the image and check what you are getting. You need to reshape the image but depending on the channels you either do 1, 3 or 4