kyleskom / NBA-Machine-Learning-Sports-Betting

NBA sports betting using machine learning
1.16k stars 431 forks source link

Error after training new model #326

Closed Noehy closed 9 months ago

Noehy commented 10 months ago

I get the following error message after running this command: C:\NBA-Machine-Learning-Sports-Betting>python3 main.py -xgb -odds=fanduel

Traceback (most recent call last):
  File "C:\NBA-Machine-Learning-Sports-Betting\main.py", line 9, in <module>
    from src.Predict import NN_Runner, XGBoost_Runner
  File "C:\NBA-Machine-Learning-Sports-Betting\src\Predict\NN_Runner.py", line 12, in <module>
    model = load_model('Models/NN_Models/Trained-Model-ML-1680133120.689445')
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\steep\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\keras\src\saving\saving_api.py", line 262, in load_model
    return legacy_sm_saving_lib.load_model(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\steep\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\keras\src\utils\traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "C:\Users\steep\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\keras\src\saving\legacy\saved_model\load.py", line 113, in load
    raise IOError(
OSError: Cannot parse keras metadata at path Models/NN_Models/Trained-Model-ML-1680133120.689445\keras_metadata.pb: Received error: Error parsing message
linus-oberli commented 10 months ago

I had the same problem installing it with git clone, it worked for me when I downloaded the latest release and installed it this way

https://github.com/kyleskom/NBA-Machine-Learning-Sports-Betting/releases/tag/4.0