DexiNed icon indicating copy to clipboard operation
DexiNed copied to clipboard

Can't parse 'dsize'. Sequence item with index 0 has a wrong type

Open Deerzh opened this issue 1 year ago • 0 comments

when I run this command, an error occurred,like this: Number of GPU's available: 3 Pytorch version: 1.11.0 mean_bgr: [103.939, 116.779, 123.68] ------ Random seed applied------------- Thu Aug 11 11:15:45 2022 Epoch: 0 Sample 0/76 Loss: 1.767072081565857 Thu Aug 11 11:15:47 2022 Epoch: 0 Sample 5/76 Loss: 1.3390700817108154 Thu Aug 11 11:15:48 2022 Epoch: 0 Sample 10/76 Loss: 2.1880481243133545 Thu Aug 11 11:15:50 2022 Epoch: 0 Sample 15/76 Loss: 1.0683614015579224 Thu Aug 11 11:15:51 2022 Epoch: 0 Sample 20/76 Loss: 2.073197841644287 Thu Aug 11 11:15:53 2022 Epoch: 0 Sample 25/76 Loss: 2.0256943702697754 Thu Aug 11 11:15:54 2022 Epoch: 0 Sample 30/76 Loss: 1.8952668905258179 Thu Aug 11 11:15:56 2022 Epoch: 0 Sample 35/76 Loss: 1.8003201484680176 Thu Aug 11 11:15:57 2022 Epoch: 0 Sample 40/76 Loss: 2.2786903381347656 Thu Aug 11 11:15:59 2022 Epoch: 0 Sample 45/76 Loss: 1.9410910606384277 Thu Aug 11 11:16:00 2022 Epoch: 0 Sample 50/76 Loss: 2.3713040351867676 Thu Aug 11 11:16:02 2022 Epoch: 0 Sample 55/76 Loss: 1.748538613319397 Thu Aug 11 11:16:03 2022 Epoch: 0 Sample 60/76 Loss: 1.5733180046081543 Thu Aug 11 11:16:05 2022 Epoch: 0 Sample 65/76 Loss: 2.090831756591797 Thu Aug 11 11:16:06 2022 Epoch: 0 Sample 70/76 Loss: 2.0399258136749268 Thu Aug 11 11:16:08 2022 Epoch: 0 Sample 75/76 Loss: 1.6606718301773071 actual size: (512, 512, 3), target size: (512, 512) /home/zhang/compatibility_analysis/DexiNed/utils/image.py:40: FutureWarning: The input object of type 'Tensor' is an array-like implementing one of the corresponding protocols (__array__, __array_interface__ or __array_struct__); but not a sequence (or 0-D). In the future, this object will be coerced as if it was first converted using np.array(obj). To retain the old behaviour, you have to either modify the type 'Tensor', or assign to an empty array created with np.empty(correct_shape, dtype=object). img_shape = np.array(img_shape) /home/zhang/compatibility_analysis/DexiNed/utils/image.py:40: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. img_shape = np.array(img_shape) Traceback (most recent call last): File "main.py", line 475, in main(args) File "main.py", line 457, in main arg=args) File "main.py", line 109, in validate_one_epoch arg=arg) File "/home/zhang/compatibility_analysis/DexiNed/utils/image.py", line 46, in save_image_batch_to_disk image_vis =cv2.resize(image_vis, dsize=(img_shape[1], img_shape[0])) cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'resize'

Overload resolution failed:

  • Can't parse 'dsize'. Sequence item with index 0 has a wrong type
  • Can't parse 'dsize'. Sequence item with index 0 has a wrong type

Can you help me fix this issue

Deerzh avatar Aug 11 '22 03:08 Deerzh