Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda issue, recent Pytorch support #287

Open
jdart1 opened this issue Sep 15, 2024 · 0 comments
Open

conda issue, recent Pytorch support #287

jdart1 opened this issue Sep 15, 2024 · 0 comments

Comments

@jdart1
Copy link

jdart1 commented Sep 15, 2024

Trying to run this under Anaconda with the supplied requrirements.txt, I am getting an exception. I have tried a couple different Anaconda releases, most recently Anaconda3-2023.03-1, based on Python 3.10.

Traceback (most recent call last):
  File "/home/jdart/chess/stockfish-pytorch/nnue-pytorch/train.py", line 175, in <module>
    main()
  File "/home/jdart/chess/stockfish-pytorch/nnue-pytorch/train.py", line 146, in main
    checkpoint_callback = pl.callbacks.ModelCheckpoint(save_last=args.save_last_network, every_n_epochs=args.network_save_period, save_top_k=-1)
  File "/home/jdart/miniconda3/envs/nnue/lib/python3.11/site-packages/pytorch_lightning/callbacks/model_checkpoint.py", line 242, in __init__
    self.__init_monitor_mode(mode)
  File "/home/jdart/miniconda3/envs/nnue/lib/python3.11/site-packages/pytorch_lightning/callbacks/model_checkpoint.py", line 446, in __init_monitor_mo\
de
    torch_inf = torch.tensor(np.Inf)
                             ^^^^^^
  File "/home/jdart/miniconda3/envs/nnue/lib/python3.11/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.Inf` was removed in the NumPy 2.0 release. Use `np.inf` instead.. Did you mean: 'inf'?

downgrading numpy to 1.26.4 seems to work. This should be specified in the requirements.txt.

Eventually, this code should support numpy 2.x, which would also require torch>=2.3.0. However, you can't upgrade to this pytorch version w/o code changes because the compatible pytorch-lightning has breaking changes, notably in command-line parsing (uses .yml config files now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant