Home > other >  An error when pytorch load images of different sizes
An error when pytorch load images of different sizes

Time:09-21

# program
For I, the labels in enumerate (test_data) :
Print (12)

# error
Traceback (the most recent call last) :
The File "D: \ SOFTWARE \ Z Anacond 3 \ lib \ site - packages \ IPython \ core \ interactiveshell py", line 3325, in run_code
Exec (code_obj, self user_global_ns, self user_ns)
The File "& lt; Ipython - input - 12-31 a3ae4ffe10 & gt;" , the line 1, the in & lt; module>
For I, the labels in enumerate (test_data) :
The File "D: \ SOFTWARE \ Z Anacond 3 \ lib \ torch \ utils \ data \ dataloader py", line 346, in __next__
Data=https://bbs.csdn.net/topics/self._dataset_fetcher.fetch # (index) may raise StopIteration
The File "D: \ SOFTWARE \ Z Anacond 3 \ lib \ torch \ utils \ data \ _utils \ fetch py", line 47, fetch in
Return the self. Collate_fn (data)
The File "D: \ SOFTWARE \ Z Anacond 3 \ lib \ torch \ utils \ data \ _utils \ collate py", line 79, in default_collate
Return [default_collate (samples) for samples in transposed]
The File "D: \ SOFTWARE \ Z Anacond 3 \ lib \ torch \ utils \ data \ _utils \ collate py", line 79, in & lt; Listcomp>
Return [default_collate (samples) for samples in transposed]
The File "D: \ SOFTWARE \ Z Anacond 3 \ lib \ torch \ utils \ data \ _utils \ collate py", line 55, in default_collate
Return the torch. The stack (batch, 0, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match the except in dimension 0. 215 and Got 258 in dimension at C: \ w \ \ Windows \ \ s 1 pytorch \ aten \ SRC \ TH/generic/THTensor CPP: 689
A=test_data


Read the DataLoader data error
  • Related