binghuang2018 / aqml

Amons-based quantum machine learning for quantum chemistry
MIT License
24 stars 4 forks source link

Problem with the demo example #2

Open rafalszabla1 opened 1 year ago

rafalszabla1 commented 1 year ago

Hi,

I've been trying to run the demo example from AQML, and the generation of amons works without any problems. However, when I run the train command it faces a problem with reading the xyz files from the demo. I am using the files that were provided with the tutorial, and I double checked their contents so everything should be fine. The error is below:

Running

aqml -train g7 -test target -p b3lypvdz 

gives


Traceback (most recent call last):
  File "/home/rafal/bin/anaconda3/lib/python3.9/site-packages/aqml/bin/aqml", line 190, in <module>
    obj.run()
  File "/home/rafal/bin/anaconda3/lib/python3.9/site-packages/cml/algo/aqml.py", line 582, in run
    obj = cc.molecules(fsk, [ag.p], unit=unit, isimple=isimple)
  File "/home/rafal/bin/anaconda3/lib/python3.9/site-packages/aqml/cheminfo/core.py", line 176, in __init__
    _nas, _zs, _coords, _nsheav, _props = obj2m(objs, property_names=property_names, idx=idx, isimple=isimple, unit=unit)
  File "/home/rafal/bin/anaconda3/lib/python3.9/site-packages/aqml/cheminfo/core.py", line 44, in obj2m
    _nas, _zs, _coords, _nsheav, _props = func(_obj, property_names=property_names, idx=idx)
  File "/home/rafal/bin/anaconda3/lib/python3.9/site-packages/aqml/cheminfo/rw/xyz.py", line 97, in read_xyz
    for i,mi in enumerate(rx.read_xyz(fileobj, index=index, properties_parser=rx.key_val_str_to_dict_regex)):
  File "/home/rafal/bin/anaconda3/lib/python3.9/site-packages/ase/io/extxyz.py", line 732, in read_xyz
    fileobj.seek(0)
ValueError: I/O operation on closed file.

I installed all the prerequisites and I'm using python 3.9. I would really appreciate your help and any ideas about the problem. Could it be python version incompatibility?

Best wishes, Rafal

binghuang2018 commented 1 year ago

This could be caused by several reasons: a) your input xyz file is not of the correct format (i.e., a typical XYZ file but with the second line replaced by "{property_name}={value}" pair. Note that only one molecule is allowed in each XYZ file. b) the version of ase to too new to be compatible with the old one. Try python3.7 and the ase version compatible with it.