kyleskom / NBA-Machine-Learning-Sports-Betting

NBA sports betting using machine learning
1.21k stars 437 forks source link

XGBoost Running OK but NN isn't - Local #255

Closed acmeGR closed 1 year ago

acmeGR commented 1 year ago

Hello. When I run the code in colab everything works OK. When I try to run python main.py -A -odds=fanduel local, i get the below issue:

`E:\sports\NBA_venv\lib\site-packages\keras\saving\legacy\saved_model\load.py:110: RuntimeWarning: Unexpected end-group tag: Not all data was converted metadata.ParseFromString(file_content) 2023-06-07 10:31:37.020800: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. ------------------fanduel odds data------------------ Denver Nuggets (-142) @ Miami Heat (120) ---------------XGBoost Model Predictions--------------- Miami Heat vs Denver Nuggets (55.0%): OVER 214.5 (70.6%) ---------------------Expected Value-------------------- Miami Heat EV: -0.91 Denver Nuggets EV: -6.34

------------Neural Network Model Predictions----------- Traceback (most recent call last): File "E:\sports\NBA_venv\NBA-Machine-Learning-Sports-Betting\main.py", line 132, in main() File "E:\sports\NBA_venv\NBA-Machine-Learning-Sports-Betting\main.py", line 120, in main NN_Runner.nn_runner(data, todays_games_uo, frame_ml, games, home_team_odds, away_team_odds, args.kc) File "E:\sports\NBA_venv\NBA-Machine-Learning-Sports-Betting\src\Predict\NN_Runner.py", line 19, in nn_runner ml_predictions_array.append(model.predict(np.array([row]))) AttributeError: '_UserObject' object has no attribute 'predict' `

I tried with tensorflow==2.12.0rc0 and tensorflow==2.12.0rc1. I use Python 3.8

Any suggestion?

dimiforty commented 1 year ago

Same here. Suddenly this issue appears and i'm unable to run it localy.