-
Notifications
You must be signed in to change notification settings - Fork 94
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
运行train时报错 #50
Comments
@ChrisZ-123 我也有这个问题,你是否已经成功解决了? |
我发现报错是numpy版本问题。 |
D:\Anaconda3\envs\tensorflow-gpu\python.exe D:\mybs\Fatigue-Driven-Detection-Based-on-CNN-master\Train.py |
default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ..\torch\csrc\tensor\python_tensor.cpp:453.)
_C._set_default_tensor_type(t)
Traceback (most recent call last):
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\Train.py", line 111, in
train()
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\Train.py", line 84, in train
for step,(img,target) in enumerate(data_loader):
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data\dataloader.py", line 630, in next
data = self._next_data()
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data\dataloader.py", line 674, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Lenovo\AppData\Roaming\Python\Python310\site-packages\torch\utils\data_utils\fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\voc0712.py", line 111, in getitem
im, gt, h, w = self.pull_item(index)
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\voc0712.py", line 130, in pull_item
img, boxes, labels = self.transform(img, target[:, :4], target[:, 4])
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\augmentations.py", line 416, in call
return self.augment(img, boxes, labels)
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\augmentations.py", line 51, in call
img, boxes, labels = t(img, boxes, labels)
File "c:\Users\Lenovo\Desktop\Fatigue-Driven-Detection-Based-on-CNN-master\augmentations.py", line 237, in call
mode = random.choice(self.sample_options)
File "numpy\random\mtrand.pyx", line 936, in numpy.random.mtrand.RandomState.choice
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part.
The text was updated successfully, but these errors were encountered: