mattragoza/LiGAN

AttributeError when using generate.py

Matheo-Chang opened this issue · 2 comments

Excuse me, when I use the command python3 generate.py config/generate.config. It appears a problem as follows:

Traceback (most recent call last):
File "generate.py", line 48, in
main(sys.argv[1:])
File "generate.py", line 41, in main
debug=args.debug,
File "/da1/home/changhaoyu/liGAN/liGAN/generating.py", line 98, in init
**output_kws,
File "/da1/home/changhaoyu/liGAN/liGAN/generating.py", line 671, in init
self.metrics = pd.DataFrame(columns=columns).set_index(columns)
File "/home/changhaoyu/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/core/frame.py", line 392, in init
mgr = init_dict(data, index, columns, dtype=dtype)
File "/home/changhaoyu/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 196, in init_dict
nan_dtype)
File "/home/changhaoyu/anaconda3/envs/py37/lib/python3.7/site-packages/pandas/core/dtypes/cast.py", line 1175, in construct_1d_arraylike_from_scalar
dtype = dtype.dtype
AttributeError: type object 'object' has no attribute 'dtype'

How can I solve it?

Seems like it's due to numpy 1.20.0: https://stackoverflow.com/questions/65998646/pandas-error-for-creating-an-emptydataframe

I'd rather not impose a numpy version requirement, though, so I'll push the fix recommended in that SO thread.

Successfully solved ! Thank you for you attention !