kyleskom / NBA-Machine-Learning-Sports-Betting

NBA sports betting using machine learning
1.17k stars 430 forks source link

Numpy Attribute Error #65

Closed nickbarmore7 closed 1 year ago

nickbarmore7 commented 1 year ago

Hey Kyle,

Thanks a ton for all your work creating this.

When running: ! python3 /content/NBA-Machine-Learning-Sports-Betting/main.py -xgb -odds=fanduel

I'm getting a numpy error that says:

File "/usr/local/lib/python3.8/dist-packages/numpy/init.py", line 284, in getattr raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'object'

I can't figure out this error, has anyone ran into anything like this before?

nickbarmore7 commented 1 year ago

Update: According to Stack Overflow (https://stackoverflow.com/questions/75069062/module-numpy-has-no-attribute-object):

"Since version 1.24 of numpy, np.object is deprecated, and needs to be replaced with object (cf. numpy release notes).

You either need to update this in your code, or another package you're using needs to be updated (not possible to answer without more information).

One (dirty) workaround for now would be to fix your numpy version to the last version still supporting np.object with pip install numpy==1.23.4"

However downgrading numpy to 1.23.4 gives a sperate error of: File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/saved_model/loader_impl.py", line 118, in parse_saved_model raise IOError( OSError: SavedModel file does not exist at: Models/NN_Models/Trained-Model-ML/{saved_model.pbtxt|saved_model.pb}

So I'm still stuck.

kyleskom commented 1 year ago

Are you running this locally or on a notebook?

nickbarmore7 commented 1 year ago

@kyleskom I'm running on a google colab notebook

kyleskom commented 1 year ago

I suspect thats the issue. I run locally. I think the issue is related to the path of the models.

nickbarmore7 commented 1 year ago

@kyleskom Running it locally worked! I really appreciate it.