Coder Social home page Coder Social logo

ghs-s2net's People

Contributors

christinacorbane avatar misterspook avatar syrriva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ghs-s2net's Issues

Prediction script

Is it possible to provide the prediction script as well.
I'm having issues putting everything together to complete the process.

Bugs in GHS_S2_run_CNN

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

Is it possible to predict with low technical spec laptops?

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

Error handling

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?

Missing requirements.txt

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.