SJ001/AI-Feynman

Error: 'int' object has no attribute 'cpu'

Opened this issue · 1 comments

yecyn commented

Hello,

I run into the following errors when I was trying my own dataset, and I was wondering if someone would please help me figure out the problem. Thank you so much!

Here's the errors:


AttributeError Traceback (most recent call last)
in
2 # Run Bass Example as the regression dataset
3 #run_aifeynman("/content/gdrive/MyDrive/AI-Feynman-1/","LinearDemandExample.txt",30,"14ops.txt", polyfit_deg=3, NN_epochs=400)
----> 4 run_aifeynman("/content/AI-Feynman/","Movie_21_Jump_Street.txt",30,"14ops.txt", polyfit_deg=3, NN_epochs=400)
5 get_ipython().system('cat /content/AI-Feynman/results/solution_Movie_21_Jump_Street.txt')
6 #!cat /content/gdrive/MyDrive/AI-Feynman-1/results/solution_LinearDemandExample.txt

1 frames
/content/AI-Feynman/aifeynman/S_run_aifeynman.py in run_aifeynman(pathdir, filename, BF_try_time, BF_ops_file_type, polyfit_deg, NN_epochs, vars_name, test_percentage)
271 PA = ParetoSet()
272 # Run the code on the train data
--> 273 PA = run_AI_all(pathdir,filename+"_train",BF_try_time,BF_ops_file_type, polyfit_deg, NN_epochs, PA=PA)
274 PA_list = PA.get_pareto_points()
275

/content/AI-Feynman/aifeynman/S_run_aifeynman.py in run_AI_all(pathdir, filename, BF_try_time, BF_ops_file_type, polyfit_deg, NN_epochs, PA)
94 idx_min = -1
95 else:
---> 96 idx_min = np.argmin(np.array([symmetry_plus_result[0], symmetry_minus_result[0], symmetry_multiply_result[0], symmetry_divide_result[0], separability_plus_result[0], separability_multiply_result[0]]))
97 print("")
98 # Check if compositionality is better than the best so far

AttributeError: 'int' object has no attribute 'cpu'

This seems to be the same problem as #57. You can try and manually apply the fix presented in #75. Just check the "Files changed" tab to see which file to modify where.