cgcnn
cgcnn copied to clipboard
CGCNN can't run on certain CIF files
Hello,
Great work with the project. I have been using CGCNN for perovskites, with the CIF files taken from ICSD database. However, I found out that it only works with certain CIF files, but not the others. Does it only take a certain "type" of CIF files? If so, how do I change the CIF files which don't work to the format that can be inputted into CGCNN?
As a reference, here are some of the ICSD collection codes:
- Working: 110630, 243861, 252316, 255885, 255886, 432089
- Not working: 252317, 252318, 252319, 252320, 254340, 254341, 434118, 432090, 254288
The error that comes out:
Traceback (most recent call last):
File "main.py", line 513, in <module>
main()
File "main.py", line 119, in main
sample_data_list = [dataset[i] for i in range(len(dataset))]
File "main.py", line 119, in <listcomp>
sample_data_list = [dataset[i] for i in range(len(dataset))]
File "/run/user/1000/gvfs/user/cgcnn-ubuntu/cgcnn-master/cgcnn/data.py", line 326, in __getitem__
print("Specie number: ",crystal[0].specie.number)
File "/home/user/miniconda3/envs/cgcnn/lib/python3.7/site-packages/pymatgen/core/sites.py", line 79, in __getattr__
raise AttributeError(a)
AttributeError: specie
Thank you!
This is an issue with the Pymatgen CIF parser. I recommend reading in each of your CIFs with ASE and writing them back out again with ASE, which will result in a CIF format that Pymatgen can read.
I have tried using both Pymatgen CIF parser, as well as reading and rewriting the CIFs with ASE, but it's still not working. The same error still appears.
Perhaps the CIF file itself has problems. Sometimes I saw CIF files that include invalid elements like Wa
. It cannot be parsed by the pymatgen, so you see an error with the specie.
I have experienced same problem. so I didn't use cif files directly. I have used pymatgen MPRester and directly accessed to a material-project without using cif file and extract it to a 'structure'.