Closed themousepotato closed 3 years ago
Hello, this seems to be a problem with GDAL, not the core DSen2 method. Did you try debugging the gdal.Create()
method? Do you have permission to write to the requested file?
Could you please elaborate? FYI I can still successfully run the demoDSen2.py
file.
Hi! The problem seems to be related to the fact that the dataset created is not closed after writing the different bands. I suggest you to add result_dataset = None
and, by checking also GDAL debugging logs, you will see something like that:
GDAL: Flushing dirty blocks: 0...10...20...30...40...50...60...70...80...90...100 - done. GDAL: GDALClose(/path/to/output.tif, this=0x557a15655d10)
Hope it helps.
The program executes fine, no problems at a glance. However, the image generated (.tif) is simply a black image of size: 165MB. What is happening? How do I get this to correctly work?
`(c:\dsen2) C:\DSen2\DSen2-master\testing>python s2_tiles_supres.py C:\DSen2\DSen2-master\output\S2A_MSIL1C_20170216T015741_N0204_R060_T52SFB_20170216T015924.SAFE\MTD_MSIL1C.xml C:\DSen2\DSen2-master\output\output.tif --roi_x_y "100,100,2000,2000" 2021-06-27 21:54:15.211953: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudart64_110.dll Selected UTM Zone: UTM 52N Selected pixel region: xmin=96, ymin=96, xmax=1997, ymax=1997: Image size: width=1902 x height=1902 Selected 10m bands: B4 B3 B2 B8 Selected 20m bands: B5 B6 B7 B8A B11 B12 Selected 60m bands: Loading selected data from: Bands B2, B3, B4, B8 with 10m resolution, UTM 52N Loading selected data from: Bands B5, B6, B7, B8A, B11, B12 with 20m resolution, UTM 52N Super-resolving the 20m data into 10m bands 2021-06-27 21:54:21.558217: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library nvcuda.dll 2021-06-27 21:54:21.579561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: pciBusID: 0000:03:00.0 name: NVIDIA GeForce GTX 970 computeCapability: 5.2 coreClock: 1.253GHz coreCount: 13 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 208.91GiB/s 2021-06-27 21:54:21.579748: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudart64_110.dll 2021-06-27 21:54:21.589145: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublas64_11.dll 2021-06-27 21:54:21.590339: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublasLt64_11.dll 2021-06-27 21:54:21.594958: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cufft64_10.dll 2021-06-27 21:54:21.596431: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library curand64_10.dll 2021-06-27 21:54:21.599532: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cusolver64_11.dll 2021-06-27 21:54:21.604102: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cusparse64_11.dll 2021-06-27 21:54:21.604948: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudnn64_8.dll 2021-06-27 21:54:21.605083: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0 2021-06-27 21:54:21.605896: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2021-06-27 21:54:21.606660: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: pciBusID: 0000:03:00.0 name: NVIDIA GeForce GTX 970 computeCapability: 5.2 coreClock: 1.253GHz coreCount: 13 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 208.91GiB/s 2021-06-27 21:54:21.608467: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0 2021-06-27 21:54:22.067331: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix: 2021-06-27 21:54:22.067438: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264] 0 2021-06-27 21:54:22.069050: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0: N 2021-06-27 21:54:22.069858: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 2776 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce GTX 970, pci bus id: 0000:03:00.0, compute capability: 5.2) Symbolic Model Created. Predicting using file: ../models/s2_032_lr_1e-04.hdf5 2021-06-27 21:54:22.588953: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:176] None of the MLIR Optimization Passes are enabled (registered 2) 2021-06-27 21:54:28.943358: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudnn64_8.dll 2021-06-27 21:54:29.218264: I tensorflow/stream_executor/cuda/cuda_dnn.cc:359] Loaded cuDNN version 8100 2021-06-27 21:54:29.838396: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublas64_11.dll 2021-06-27 21:54:30.161958: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublasLt64_11.dll 2021-06-27 21:54:30.325501: W tensorflow/core/common_runtime/bfc_allocator.cc:271] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.27GiB with freed_by_count=0. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available. 2021-06-27 21:54:30.593855: W tensorflow/core/common_runtime/bfc_allocator.cc:271] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.27GiB with freed_by_count=0. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available. 2021-06-27 21:54:31.153012: W tensorflow/core/common_runtime/bfc_allocator.cc:271] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.41GiB with freed_by_count=0. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available. 10/10 [==============================] - 12s 397ms/step (6, 1902, 1902) Writing the super-resolved bands in C:\DSen2\DSen2-master\output\output.tif SRB5 (705 nm) SRB6 (740 nm) SRB7 (783 nm) SRB8A (865 nm) SRB11 (1610 nm) SRB12 (2190 nm)
(c:\dsen2) C:\DSen2\DSen2-master\testing>`
I tried executing the following command and it generates an
output.tif
of 8 bytes but I'm unable to read it.