Open prativadas opened 5 years ago
when i change this line in train_unet train_xsz = int(3/4 img_m.shape[0]) to this train_xsz = int(img_m.shape[0](0.75)) the error goes away and model starts training
I had the same error. My problem was caused by a difference in data structures. The imagery I wanted to train on was already correctly formatted, so I did not need to use numpy.transpose() to get img.shape and mask.shape in the proper order (X, Y, channels). Changing train_unet.py to transpose the data into the correct format should help you clear the assertion check.
when i change this line in train_unet train_xsz = int(3/4 img_m.shape[0]) to this train_xsz = int(img_m.shape[0](0.75)) the error goes away and model starts training
Thank you, it was useful!
Hello , can somone help me please in this code , when i run the Train_unet i get this error :
start train net Generated 4000 patches Generated 1000 patches
InvalidArgumentError Traceback (most recent call last) ~\anaconda3\envs\tf3\lib\site-packages\tensorflow_core\python\framework\ops.py in _create_c_op(graph, node_def, inputs, control_inputs) 1618 try: -> 1619 c_op = c_api.TF_FinishOperation(op_desc) 1620 except errors.InvalidArgumentError as e:
InvalidArgumentError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_20/MaxPool' (op: 'MaxPool') with input shapes: [?,1,1,512].
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
assert len(img.shape) == 3 and img.shape[0] > sz and img.shape[1] > sz and img.shape[0:2] == mask.shape[0:2] this is getting Assertion error while running train_unet.py
how to resolve this?