ec-jrc / ghs-s2net Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Is it possible to use the model for other categories (forests, agriculture)?
Hello!
You did a great job.
I wanted to test the prediction over the Bayern area. Is it possible to do it? or I can do It only by UTM zones?
Is it possible to provide the prediction script as well.
I'm having issues putting everything together to complete the process.
Dear,
I am using your code to train new models for my study area. I have noticed that there are some bugs in the code for example in line 267 the code tries to perform ModelChecKpoint for fnmodel. But in the code the fnmodel is assigned later.
This is a simple issue I could just assign the fnmodel before this line or comment this line out all together.
Both let me run the training and create a CNN model. What I noticed is that when I use the two CNN models to do prediction I see a big difference in the accuracy of the prediction.
I am wondering do you have an update version of the code that you could share?
Thanks and regards,
Dinesh
Hello again! Is it possible to somehow run predict script with regular laptops?
My specs are:
I7-7700hq 2.8 GHz,
RAM 16 GB,
GPU: GTX1050Ti
Currently I am getting
numpy.core._exceptions.MemoryError: Unable to allocate 50.5 GiB for an array with shape (23296, 23296, 1, 5, 5, 1) and data type float32
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:
(2779, 3286, 4)
0 1 2 3 Traceback (most recent call last):
File "C:/Users/Gigabyte/PycharmProjects/GHS-S2Net/code/GHS_S2_run_prediction.py", line 109, in <module>
Response = model.predict(T2, batch_size=batch_size*16, verbose = 0)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\keras\engine\training.py", line 1462, in predict
callbacks=callbacks)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\keras\engine\training_arrays.py", line 324, in predict_loop
batch_outs = f(ins_batch)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\keras\backend.py", line 3740, in __call__
outputs = self._graph_fn(*converted_inputs)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 1081, in __call__
return self._call_impl(args, kwargs)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 1121, in _call_impl
return self._call_flat(args, self.captured_inputs, cancellation_manager)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 1224, in _call_flat
ctx, args, cancellation_manager=cancellation_manager)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 511, in call
ctx=ctx)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute
six.raise_from(core._status_to_exception(e.code, message), None)
File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[800000,128,4,4] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[node sequential_2_1/conv2d_5/convolution (defined at \Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\framework\ops.py:1751) ]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
[Op:__inference_keras_scratch_graph_7641]
the second one (I changed:
I2[I2>500] = 500
I2 = I2 / 500.
Batch size to 1000
):
Traceback (most recent call last):
File "C:/Users/Gigabyte/PycharmProjects/GHS-S2Net/code/GHS_S2_run_prediction.py", line 109, in <module>
Response = model.predict(T2, batch_size=batch_size*16, verbose = 0)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\keras\engine\training.py", line 1462, in predict
callbacks=callbacks)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\keras\engine\training_arrays.py", line 324, in predict_loop
batch_outs = f(ins_batch)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\keras\backend.py", line 3740, in __call__
outputs = self._graph_fn(*converted_inputs)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 1081, in __call__
return self._call_impl(args, kwargs)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 1121, in _call_impl
return self._call_flat(args, self.captured_inputs, cancellation_manager)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 1224, in _call_flat
ctx, args, cancellation_manager=cancellation_manager)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\function.py", line 511, in call
ctx=ctx)
File "C:\Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute
six.raise_from(core._status_to_exception(e.code, message), None)
File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[node sequential_2_1/conv2d_5/convolution (defined at \Users\Gigabyte\PycharmProjects\pythonProject\DSP\lib\site-packages\tensorflow_core\python\framework\ops.py:1751) ]] [Op:__inference_keras_scratch_graph_7641]
Function call stack:
keras_scratch_graph
Can you please recommend some steps to handle these errors?
Dear authors,
what are the Python version and Python package versions that have been tested with the codebase? I'm using the following setup to execute code/GHS_S2_run_prediction.py
:
Python 3.6.9
on Ubuntu 18.04
and the pip package versions:
tensorflow==1.15
Keras==2.3.1
GDAL==3.04
I'm getting the following error when running code/GHS_S2_run_prediction.py
:
XXX lineno: 187, opcode: 160
Traceback (most recent call last):
File "GHS_S2_run_prediction.py", line 74, in <module>
model = load_model('../Pretrained_models/MODEL_CNN_32T' + '.h5')
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/saving.py", line 584, in load_model
model = _deserialize_model(h5dict, custom_objects, compile)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/saving.py", line 274, in _deserialize_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/saving.py", line 627, in model_from_config
/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/tensorflow/include/tensorflow/c return deserialize(config, custom_objects=custom_objects)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/layers/__init__.py", line 168, in deserialize
printable_module_name='layer')
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 147, in deserialize_keras_object
list(custom_objects.items())))
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/network.py", line 1075, in from_config
process_node(layer, node_data)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/network.py", line 1025, in process_node
layer(unpack_singleton(input_tensors), **kwargs)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/engine/base_layer.py", line 489, in __call__
output = self.call(inputs, **kwargs)
File "/persistent/swagner/GHS-S2Net/env/lib/python3.6/site-packages/keras/layers/core.py", line 716, in call
return self.function(inputs, **arguments)
File "/opt/venv/lib/python3.7/site-packages/keras/utils/multi_gpu_utils.py", line 187, in get_slice
SystemError: unknown opcode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.