mitmul / ssai-cnn

Semantic Segmentation for Aerial / Satellite Images with Convolutional Neural Networks including an unofficial implementation of Volodymyr Mnih's methods
http://www.ingentaconnect.com/content/ist/jist/2016/00000060/00000001/art00003
MIT License
260 stars 75 forks source link

cannot reshape array of size 3 into shape (92,92,3) #23

Closed flor88 closed 6 years ago

flor88 commented 6 years ago

Hi there! I'm having trouble to run this bash shells/create_dataset.sh

The error is this: patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 patch size: 92 24 16 n_all_files: 0 patches: 0 Traceback (most recent call last): File "tests/test_dataset.py", line 36, in o_val, dtype=np.uint8).reshape((92, 92, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_dataset.py", line 36, in o_val, dtype=np.uint8).reshape((92, 92, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_dataset.py", line 36, in o_val, dtype=np.uint8).reshape((92, 92, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_dataset.py", line 36, in o_val, dtype=np.uint8).reshape((92, 92, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_transform.py", line 55, in (args.ortho_original_side, args.ortho_original_side, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_transform.py", line 55, in (args.ortho_original_side, args.ortho_original_side, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_transform.py", line 55, in (args.ortho_original_side, args.ortho_original_side, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3) Traceback (most recent call last): File "tests/test_transform.py", line 55, in (args.ortho_original_side, args.ortho_original_side, 3)) ValueError: cannot reshape array of size 0 into shape (92,92,3)

Any ideas? Thank you very much for your time!

mitmul commented 6 years ago

Where did you put the dataset?

flor88 commented 6 years ago

screenshot from 2018-03-26 11-41-01 In data, i didn't change anything on the script of the README file. but I had some trouble downloading the images. Do you think that can be the problem?

Thank you very much!

flor88 commented 6 years ago

Problem solved! The dataset was broken. I've downloaded it again, and it worked. Now I'm having problems with space on disk.

flor88 commented 6 years ago

After running create_dataset.sh the folder "data" weights 169,1 GB, is this right? I couln't end the processing because I don't have more space on the disk

Avery1991 commented 6 years ago

@flor88 Hi, friend. Sorry to distrub you. I have tired out to compile the environment which can make the codes run, and I changed Ubuntu from 14.04 to 16.04, and OpenCV from 3.0.0 to 3.4.1,, but it failed many times, either OpenCV irregular installation or Boost could not found targets. Could you please tell me your installation in detail? What versions are your cmake, anaconda, boost, and OpenCV. Thanks so much for your kindly help.

flor88 commented 6 years ago

Hi @Avery1991 I installed all of this a few days ago in Ubuntu 16.04:

The cmake version 3.5.1

Installed the last version of pip (pip 9.0.1)

Anaconda for python 3.6 (conda 4.5.0), the last one provided for linux here: https://conda.io/docs/user-guide/install/index.html

Chainer

pip install chainer (although now i'm trying to run the prediction with the gpu, and I have some errors with the installation, I'm reinstaling my CUDA toolkit just in case)

Cython

Cython version 0.26.1

pip install Cython --install-option="--no-cython-compile"

Numpy

pip install numpy

tqdm (4.19.9)

pip install tqdm

OpenCV 3.0.0 (same as the README file from Saito san)

this may be needed: pip install opencv-python pip install lmdb

Boost 1.59. 0

I've downloaded the .tar version from the page directly, and run the commands on the README file, since the tar.bz2 that I've downloaded from the terminal didn't seem to work properly Remember to set the proper path to your python, mine was : $ ./b2 -j32 install cxxflags="-I/home/ubuntu/anaconda3/include/python3.6m"

Boost.NumPy

Also the same as the README file. I had to add to CMakeCache.txt the root to anaconda3/include/python3.6m. I also had to change in CMakeCache.txt libboost_python.so for libboost_python3.so

I have also changed all the scripts to include python3.6 instead of python3.5. This is very important because the scripts are fixed to 3.5 so you need run this: find ./ -type f -exec sed -i'' -e 's/python3.5m/python3.6m/g' {} +
inside the file ssai-cnn-master.

Build utils

After all this, I builded ## Build utils. I had to add my python path to anaconda in the build.sh

Create data set

Then downloaded the dataset (make sure you don't have any fails.) To run create_dataset.sh I had to export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/bin:/usr/local/lib64 and also export my Python Path.

I detailed all the steps because I'm very clumsy with this kind of stuff, I really hope I was clear and that you can run the scripts too.

Have a nice day!

Kkevin4 commented 6 years ago

@flor88 hi ,my friend,Have you completed the whole process with the Readme now?I have a lot of problem to ask you, Thanks so much for your kindly help.

flor88 commented 6 years ago

Hi @Kkevin4! Yes, I followed the Readme file, but I made changes, the details are in my previous comment. :)