Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[help wanted] cannot run the train.py successfully #5

Open
DFTandQC opened this issue Sep 14, 2023 · 1 comment
Open

[help wanted] cannot run the train.py successfully #5

DFTandQC opened this issue Sep 14, 2023 · 1 comment

Comments

@DFTandQC
Copy link

I hope you can help solve the problem. I use anaconda for the creation of a virtual environment and run train.py in spyder with python 3.11. When I run the train.py, there shows up the error. The dataset used by this code is sn2_reactions.npz, which is got from: https://zenodo.org/record/2605341. Other files and parameters are not verified.

THe error report:

File D:\programs\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File d:\programs\qml\copies\physnet-master\physnet-master\train.py:122
Eshift=data_provider.EperA_mean,

File D:\programs\qml\copies\PhysNet-master\PhysNet-master\training\DataProvider.py:106 in EperA_mean
self._compute_E_statistics()

File D:\programs\qml\copies\PhysNet-master\PhysNet-master\training\DataProvider.py:95 in _compute_E_statistics
tmp = self.get_data(self.idx_train[i])

File D:\programs\qml\copies\PhysNet-master\PhysNet-master\training\DataProvider.py:196 in get_data
return self.data[idx]

File D:\programs\qml\copies\PhysNet-master\PhysNet-master\training\DataContainer.py:147 in getitem
for k, i in enumerate(idx):

TypeError: 'numpy.int32' object is not iterable

Desktop
OS: [Windows11]
Anaconda version:conda 23.7.3
Python Version: [3.11.4]
Package Version: [tensorflow 2.13.0], [numpy 1.24.3]

@LIVazquezS
Copy link
Member

Hi,

Please consider doing your training with a version of Tensorflow 1. As the differences between TF1 and TF2 are very large, it is possible that you need to make changes to the code to adapt it.

For this particular problem, I think you need to run the file as:

python train.py @config.txt

It might be that it is not reading the number of training samples and then you receive an error.

Cheers,

L

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants