GDL_code
GDL_code copied to clipboard
Divide by zero error when running 04_01_gan_camel_train, missing data?
I opened the Jupyter notebook, clicked "Run all cells". Execution failed at:
(x_train, y_train) = load_safari(DATA_NAME)
...with the error:
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-5-595832a29a8f> in <module>
----> 1 (x_train, y_train) = load_safari(DATA_NAME)
~/lab/GDL_code/utils/loaders.py in load_safari(folder)
188
189 slice_train = int(80000/len(txt_name_list)) ###Setting value to be 80000 for the final dataset
--> 190 i = 0
191 seed = np.random.randint(1, 10e6)
192
ZeroDivisionError: division by zero
It looks like there's no data in the data diretory, which leads txt_name_list
to be an empty array. Is there some step necessary to pull the data?
It turns out this was answered 5 months ago in the first issue: https://github.com/davidADSP/GDL_code/issues/10.
@davidADSP would it be possible to update the README with additional instructions about data setup?
@justinwiley I have the same problem, do you solve it?
I solve by applying try and except ZeroDivisionError code below
try: slice_train = int(80000/len(txt_name_list)) ###Setting value to be 80000 for the final dataset except ZeroDivisionError: return 0 i = 0 seed = np.random.randint(1, 10e6)