AI-Feynman
AI-Feynman copied to clipboard
OSError: results_gen_sym.dat not found
Hello! I recently watched your wonderful presentation of the code at Oxford university and I am very interested in using it in my own work. I have successfully installed the code. However, when I run the test command
import aifeynman
aifeynman.get_demos("example_data")
aifeynman.run_aifeynman("./example_data/", "example1.txt", 60, "14ops.txt", polyfit_deg=3, NN_epochs=500)
to verify that the code is working I get the following error message:
Trying to solve results/gradients_gen_sym_example1.txt_train
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zcapjru/feyn/lib/python3.8/site-packages/aifeynman/S_run_aifeynman.py", line 274, in run_aifeynman
PA = run_AI_all(pathdir,filename+"_train",BF_try_time,BF_ops_file_type, polyfit_deg, NN_epochs, PA=PA)
File "/home/zcapjru/feyn/lib/python3.8/site-packages/aifeynman/S_run_aifeynman.py", line 156, in run_AI_all
bf_all_output = np.loadtxt("results_gen_sym.dat", dtype="str")
File "/home/zcapjru/feyn/lib/python3.8/site-packages/numpy/lib/npyio.py", line 961, in loadtxt
fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
File "/home/zcapjru/feyn/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 195, in open
return ds.open(path, mode, encoding=encoding, newline=newline)
File "/home/zcapjru/feyn/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 535, in open
raise IOError("%s not found." % path)
OSError: results_gen_sym.dat not found.
This seems to suggest that there’s a missing file. Has someone run this code since the last update of the repository? Thank you so much in advance and looking forward to using the code, Jaime
Hi, I have the same issue and no idea how to solve it... Thanks and best wishes, Andreas
Hi, count me in. I have the same error. Some ideas?
Same error here...maybe a results file was supposed to be generated but wasn't,,,?
I had the same error. I reset the repo to commit 3629ffe337f28bfba7f0dead54be63809a212d17 and its working fine. I suspect there is something going on in PR #22 because i saw the file being mentioned in the code but I don't know what exactly is causing this behaviour.
@florianthonig Thanks for the hint!
Did you do something like this:
cd AI-Feynman
git reset --hard 3629ffe337f28bfba7f0dead54be63809a212d17
which gives:
HEAD is now at 3629ffe Merge pull request #15 from andrewtsoc/feynman-package
Or am I missing something?
@florianthonig Thanks for the hint!
Did you do something like this:
cd AI-Feynman git reset --hard 3629ffe337f28bfba7f0dead54be63809a212d17
which gives:
HEAD is now at 3629ffe Merge pull request #15 from andrewtsoc/feynman-package
Or am I missing something?
Yes, thats what I have done
Yes...thanks Florian!
I created a local repository and used git reset to get back to your suggested commit.
But after that, unfortunately the sample problems wouldn't run as it did not recognize the aifeynman commands.
Did anyone experience that subsequent issue?
Yes...thanks Florian!
I created a local repository and used git reset to get back to your suggested commit.
But after that, unfortunately the sample problems wouldn't run as it did not recognize the aifeynman commands.
Did anyone experience that subsequent issue?
Yes in the older version the module name is just feynman. Take a look at the example in the project.
well, this shouldn't be considered as a proper solution, I'm still facing the same problem and the git reset hasn't solved it. Can we ping the author?
Late follow up but I had this error when pip installing aifeynman. It resolved itself when I downloaded 2.0.7 from pypi and installed locally in editable mode. Don't know why but may be to do with compiler issues that aren't addressed when installing directly via pip.
A very late reply, but I was unable to recreate your issue (i.e. results_gen_sym.dat was created successfully).
The file should be created upon the call
subprocess.call(["feynman_sr_mdl5"], timeout=try_time)
on line 60 of S_brute_force_gen_sym.py since this runs the fortran routine symbolic_regress_mdl5.f90. The file you want is opened on line 133 of that routine and printing happens on line 185. Given that you've called this with a timeout (and try_time = BF_try_time), I wonder whether you were timed out before you got to line 133 or 185. Since it's within a try-except, the TimeoutExpired
exception won't be noticed so you're code carries on and a file is never made.
There could be another reason, but I wonder if you increase BF_try_time (the example suggests 60 but that could be increased) it will work. Alternatively, If you remove the try-except it may be clearer why the fortran routine goes wrong.
In my case it was an OS error that I fixed following this issue.