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

Unable to create dataset. #3

Open Skylion007 opened 8 years ago

Skylion007 commented 8 years ago

I am trying to get this example running, but unfortunately, I have run into a little bit of a snag. I keep getting this error when I attempt to run create_database.sh


File "scripts/create_dataset.py", line 122, in create_patches
    key = b'%010d' % keys[n_patches]
TypeError: ufunc 'remainder' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Any ideas on how to proceed?

mitmul commented 8 years ago

Could you tell me your environment (OS, versions of python and all related packages)?

Skylion007 commented 8 years ago

A Docker container I wrote to run this project running on CentOS. I can do you one better and provide the dockerfile if you want.

Skylion007 commented 8 years ago

See #5 for the Dockerfile.

Skylion007 commented 8 years ago

I have narrowed down the error. It is caused when you attempt to create the dataset for roads or roads_mini, buildings or merged. All --single and --multi work fine.

Skylion007 commented 8 years ago

Found the bug! It was a very obscure feature in Python3.5 called bytestring formatting. For ease of deployment, I was using Python 3.4 since Ubuntu 14.04 hadn't migrated over yet so the feature wasn't supported. Luckily you can backport it by replacing the line with this little hack.

key = bytes('%010d' % keys[n_patches], 'ascii')