nperraud / download-celebA-HQ

Python script to download the celebA-HQ dataset from google drive
139 stars 27 forks source link

error in Make_hq_images.py float() argument must be a string or a number, not 'Image' #6

Closed tldoan closed 5 years ago

tldoan commented 6 years ago

Hi,

thank you for this code ! I have an error in the make_celeba_hQ.py

Traceback (most recent call last): File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/python/3.5.4/lib/python3.5/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/python/3.5.4/lib/python3.5/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "make_HQ_images.py", line 157, in do_the_work img = process_func(img_num) File "make_HQ_images.py", line 115, in process_func img = np.pad(np.float32(img), ((pad[1], pad[3]), (pad[0], pad[2]), (0, 0)), 'reflect') TypeError: float() argument must be a string or a number, not 'Image' """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "make_HQ_images.py", line 167, in pool.map(do_the_work, list(range(expected_dat))) File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/python/3.5.4/lib/python3.5/multiprocessing/pool.py", line 266, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/python/3.5.4/lib/python3.5/multiprocessing/pool.py", line 644, in get raise self._value TypeError: float() argument must be a string or a number, not 'Image'

Do you know where it can come from??

Thanks in advance

nperraud commented 6 years ago

Hello tiss94,

I do not know where it comes from. The code requires some very specific versions of software to be executed. Did you follow the README instructions?

I might also be that the requirements are not sufficiently well specified...

Best

tldoan commented 6 years ago

Hi,

Actually I have some compatiblity issues when I use conda, is it possible to do it without conda? (installing everything with pip )

Best,

nperraud commented 6 years ago

It is theoretically possible to run it with pip. This was actually my plan at the beginning. However, I was not able to get the good versions of all the different package working at the same time.

In my conda environnement I use Python 3.5.5 and pip freeze gives me

asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.1.4
idna==2.6
mkl-fft==1.0.0
mkl-random==1.0.1
numpy==1.14.2
opencv-python==3.4.0.12
Pillow==3.1.1
pycparser==2.18
pyOpenSSL==17.5.0
PySocks==1.6.8
requests==2.18.4
scipy==1.1.0
six==1.11.0
tqdm==4.23.0
urllib3==1.22

If you succeed making it work, please let me know and I will update the README.