microsoft / AutonomousDrivingCookbook

Scenarios, tutorials and demos for Autonomous Driving
MIT License
2.32k stars 566 forks source link

AxisError: #39

Closed lyhbuaa closed 6 years ago

lyhbuaa commented 6 years ago

Your issue may already be reported! Please make sure to search all open and closed issues before starting a new one.

Please fill out the sections below so we can understand your issue better and resolve it quickly.

Problem description

(Please provide a 2-3 sentence description of your problem. Be concise to ensure this description is useful for future users who might run into the same issue.)

Problem details

(Please describe your problem in as much detail as possible here. Make sure to include screenshots, code snippets, error messages, links and anything else you think will help us understand your problem better. If applicable, please also provide us a list of steps to reproduce your problem.)

Exepriment/Environment details

when I runned the TrainModel.ipynb, it raised this error: AxisError Traceback (most recent call last)

in () 24 plt.show() 25 #%pdb on ---> 26 [sample_batch_train_data, sample_batch_test_data] = next(train_generator) 27 #for i in range(0, 3, 1): 28 #draw_image_with_label(sample_batch_train_data[0][i], sample_batch_test_data[i]) ~\Anaconda3\envs\tensorflow\lib\site-packages\keras\preprocessing\image.py in __next__(self, *args, **kwargs) 858 859 def __next__(self, *args, **kwargs): --> 860 return self.next(*args, **kwargs) 861 862 def _get_batches_of_transformed_samples(self, index_array): C:\AirSimE2EDeepLearning\Generator.py in next(self) 240 # so it can be done in parallel 241 --> 242 return self.__get_indexes(index_array) 243 244 def __get_indexes(self, index_array): C:\AirSimE2EDeepLearning\Generator.py in __get_indexes(self, index_array) 262 x_images = x_images[self.roi[0]:self.roi[1], self.roi[2]:self.roi[3], :] 263 --> 264 transformed = self.image_data_generator.random_transform_with_states(x_images.astype(K.floatx())) 265 x_images = transformed[0] 266 is_horiz_flipped.append(transformed[1]) C:\AirSimE2EDeepLearning\Generator.py in random_transform_with_states(self, x, seed) 138 x = image.random_channel_shift(x, 139 self.channel_shift_range, --> 140 img_channel_axis) 141 if self.horizontal_flip: 142 if np.random.random() < 0.5: ~\Anaconda3\envs\tensorflow\lib\site-packages\keras\preprocessing\image.py in random_channel_shift(x, intensity, channel_axis) 177 178 def random_channel_shift(x, intensity, channel_axis=0): --> 179 x = np.rollaxis(x, channel_axis, 0) 180 min_x, max_x = np.min(x), np.max(x) 181 channel_images = [np.clip(x_channel + np.random.uniform(-intensity, intensity), min_x, max_x) ~\Anaconda3\envs\tensorflow\lib\site-packages\numpy\core\numeric.py in rollaxis(a, axis, start) 1470 """ 1471 n = a.ndim -> 1472 axis = normalize_axis_index(axis, n) 1473 if start < 0: 1474 start += n AxisError: axis 3 is out of bounds for array of dimension 3 Is there anybody can help me! thanks!
adshar commented 6 years ago

1