Closed manapshymyr-OB closed 3 years ago
Do not change this part of code, the training was done like this:
I2[I2>10000] = 10000
I2 = I2 / 10000.
Try with this batch size:
Response = model.predict(T2, batch_size=256, verbose = 1)
@misterspook I have clipped a small area from S2_percentile_UTM_211-0000023296-0000000000.tif
.
ValueError Traceback (most recent call last)
change the columns and rows variables to correspond to your actual array shape, they must be divisible with window size (5)
@misterspook thanks for the response. how should i calculate them based on the actual array shape? can you give an example?
A.shape will return a tuple (m, n), where m is the number of rows, and n is the number of columns.
A.shape will return a tuple (m, n), where m is the number of rows, and n is the number of columns.
Can I have your e-mail for further questions?
@misterspook I am trying to run the script but it is stopping where reshape should be done. So I am trying:
model = load_model('/content/drive/MyDrive/GHS-S2Net/Pretrained_models/MODEL_CNN_31U.h5') #https://github.com/ec-jrc/GHS-S2Net/blob/main/Pretrained_models/MODEL_CNN_32T.h5
infile = '/content/drive/MyDrive/GHS-S2Net/OUTPUT.tif'
so OUTPUT.tiff (70 mb) file is clipped file from .tiff image which is downloaded from the https://data.jrc.ec.europa.eu/dataset/0bd1dfab-e311-4046-8911-c54a8750df79.
and the shape of the input image is after the ReadImage
function equal to (4, 2779, 3286)
.
Response = model.predict(T2, batch_size=256, verbose = 1)
I tried with rows, cols = 10000, 10000
and with rows, cols = 3025, 3019
but I am getting still the reshaping errors: cannot reshape array of size 9131794 into shape (10000,10000)
or cannot reshape array of size 9131794 into shape (3025,3019)
. If I write (4, 2779, 3286)
then the size is not divisible by 5.
I clipped the image with size I have not changed any values for Image processing(all initial values are kept) and getting two errors: the first one:
the second one (I changed:
):
Can you please recommend some steps to handle these errors?