-
Notifications
You must be signed in to change notification settings - Fork 176
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
[BUG] UnboundLocalError: cannot access local variable 'stepbindex' where it is not associated with a value #1490
Comments
Please check two things and may post here: (1) the final command you ran, which should be in |
Thank you very much for your answer, but the error still appeared. In fact, I used a local computer to run the dpgen. But if there was not "remote_root" in the machine json, it would generate a new error whose log was shown below: |
I seem to know what generates this problem. The lammpstrj in the 01.build/task.000 seem to be broken, and the specific message of the sub.run file was here: |
Bug summary
When I used dpgen init_reaction to build my dataset in WSL2(Ubuntu 20.04), I met with the error "Unbound Local Error: cannot access local variable 'stepbindex' where it is not associated with a value". At first, in order to learn how to solve this problem, I used the same file and runed it on the Windows, but the problem did not appear. The specific message was shown in the part of "Steps to Reproduce"
DP-GEN Version
0.12.0
Platform, Python Version, Remote Platform, etc
WSL2(Ubuntu 20.04), python 3.11.4
Input Files, Running Commands, Error Log, etc.
Input files has been uploaded [param.json] [machine.json]
machine.json
param.json
Running Commands: dpgen init_reaction param.json machine.json
Error Log:
Traceback (most recent call last):
File "/home/penguinw/anaconda3/bin/datasetbuilder", line 8, in
sys.exit(_commandline())
^^^^^^^^^^^^^^
File "/home/penguinw/anaconda3/lib/python3.11/site-packages/mddatasetbuilder/datasetbuilder.py", line 711, in _commandline
DatasetBuilder(
File "/home/penguinw/anaconda3/lib/python3.11/site-packages/mddatasetbuilder/datasetbuilder.py", line 109, in init
self.crddetector = Detect.gettype("dump")(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/penguinw/anaconda3/lib/python3.11/site-packages/mddatasetbuilder/detect.py", line 23, in init
self.steplinenum = self._readN()
^^^^^^^^^^^^^
File "/home/penguinw/anaconda3/lib/python3.11/site-packages/mddatasetbuilder/detect.py", line 168, in _readN
steplinenum = stepbindex - stepaindex
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'stepbindex' where it is not associated with a value
Steps to Reproduce
Firstly, I used the command "dpgen init_reaction param.json machine.json" and then the error appeared.
Secondly, I used another simple file to run lammps and produce the lammpstrj and bond file. And then I used the files to run the command " datasetbuilder -d pyrolysis.lammpstrj -b pyrolysis.bonds.out -a C H N O S -np 4 -c 6 -s 5000 -n pyrolysis" on the Windows Platform by anaconda prompt, and it did not appear any error.
Thirdly, I used the file which was the same one used in the second path to run the command "dpgen init_reaction param.json machine.json", but the error still appeared.
Further Information, Files, and Links
No response
The text was updated successfully, but these errors were encountered: