SJ001/AI-Feynman

OSError: results_comp.dat not found.

Opened this issue · 4 comments

Hi,
I've correctly installed feynman-ai and all the packages. I can run the code on the GPU, but when I execute the example.py file, I face the following error:

Checking for compositionality...
Trying to solve mysteries with brute force...
Trying to solve results/gradients_comp_example1.txt_train.txt
Traceback (most recent call last):
  File "example.py", line 4, in <module>
    "14ops.txt", polyfit_deg=2, NN_epochs=20)
  File "/home/emanuele/Desktop/AI-Feynman/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/emanuele/Desktop/AI-Feynman/aifeynman/S_run_aifeynman.py", line 125, in run_AI_all
    bf_all_output = np.loadtxt("results_comp.dat", dtype="str")
  File "/home/emanuele/.local/lib/python3.6/site-packages/numpy/lib/npyio.py", line 961, in loadtxt
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "/home/emanuele/.local/lib/python3.6/site-packages/numpy/lib/_datasource.py", line 195, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "/home/emanuele/.local/lib/python3.6/site-packages/numpy/lib/_datasource.py", line 535, in open
    raise IOError("%s not found." % path)
OSError: results_comp.dat not found.

I'm running the code on a vanilla Ubuntu 18.04.05, CUDA 11.3, python3.6.9.
I run the code with sudo python3 example.py

There is a tentative solution that suggest to go back to a previous version of the code, but it doesn't work for me and I don't think it should be considered as a proper solution.

p.s. I don't want to be polemical, but I encountered so many errors and it's a month that I try to replicate, without success, even the simplest experiment of this code. The paper has been published on Science, which I reckon is one of the best scientific journals in the word, so I expect the code to be at least replicable for the simplest examples provided by the author.

Emanuele

SJ001 commented

Hello! It seems to be an OS related issue so I am not able to reproduce it now. Have your tried running in on a different OS and had the same error?

Can you tell me which are your exact configurations (OS etc.) so I can finally reproduce the code?

SJ001 commented

I am using CentOS Linux 7, CUDA 10.2, Python 3.8.3

Hello I faced the same problem as well, but managed to solve it. It turns out I did not install the setup file.

I managed to set up a Google Colab that can run one of the examples. You can compare your installation to this: https://colab.research.google.com/drive/1rIcq_zUxG6nflUYFDTFAhXumibXQYkEw?usp=sharing