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

scatterAdd not working #5

Open
matthiasanderer opened this issue Jun 13, 2018 · 14 comments
Open

scatterAdd not working #5

matthiasanderer opened this issue Jun 13, 2018 · 14 comments

Comments

@matthiasanderer
Copy link

Somehow I do not get the scatterAdd solution to work:

I got torch from:
git clone https://github.com/torch/distro.git ~/torch --recursive

then in the torch folder changed TensorMath.lua as described...

and installed via:
TORCH_LUA_VERSION=LUA52 ./install.sh

(but installed cutorch via luarocks -> is that wrong?)

after all I get:

./Game/card_tools.lua:30: attempt to call method 'scatterAdd' (a nil value)

@happypepper
Copy link
Owner

@matthiasanderer I realized that the readme doesn't say you have to modify the TensorMath.lua for cutorch as well if you want to use GPU. I will update the readme.md when I have time

@lorrp1
Copy link

lorrp1 commented Jun 15, 2018

same error:

./Game/card_tools.lua:30: attempt to call method 'scatterAdd' (a nil value)
stack traceback:
./Game/card_tools.lua:30: in function 'get_possible_hands_mask'
./Game/Evaluation/evaluator.lua:137: in function <./Game/Evaluation/evaluator.lua:132>
(...tail calls...)
./TerminalEquity/terminal_equity.lua:74: in function 'get_last_round_call_matrix'
./TerminalEquity/terminal_equity.lua:179: in function '_set_call_matrix'
./TerminalEquity/terminal_equity.lua:217: in function 'set_board'
./DataGeneration/data_generation.lua:58: in function 'generate_data_file'
./DataGeneration/data_generation.lua:24: in function 'generate_data'
DataGeneration/main_data_generation.lua:14: in main chunk
[C]: in function 'dofile'
...errr/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: in ?

@happypepper
Copy link
Owner

I've updated the readme, let me know if you are still seeing the issue.

@lorrp1
Copy link

lorrp1 commented Jun 17, 2018

this is what i get now:
cd Source && th DataGeneration/main_data_generation.lua 4
/home/painkillerrr/torch/install/bin/luajit: .../painkillerrr/torch/install/share/lua/5.1/trepl/init.lua:389: .../painkillerrr/torch/install/share/lua/5.1/trepl/init.lua:389: .../painkillerrr/torch/install/share/lua/5.1/trepl/init.lua:389: .../painkillerrr/torch/install/share/lua/5.1/trepl/init.lua:389: .../painkillerrr/torch/install/share/lua/5.1/trepl/init.lua:389: not enough memory
stack traceback:
[C]: in function 'error'
.../painkillerrr/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
DataGeneration/main_data_generation.lua:12: in main chunk
[C]: in function 'dofile'
...errr/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x004057a0

in torch/install/share/ there is 5.1 while i have installed 5.2:
$ lua
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio

im going to reinstall lua, torch and cuda toolkit

@lorrp1
Copy link

lorrp1 commented Jun 17, 2018

i reinstalled everything, i copyed the file it gave me the same error ./Game/card_tools.lua:30: attempt to call method 'scatterAdd' (a nil value), then i run: TORCH_LUA_VERSION=LUA52 ./install.sh
Prefix set to /home/painkillerrr/torch/install, another time and i get: /lua/5.1/trepl/init.lua:389: not enough memory

@happypepper
Copy link
Owner

If you are seeing not enough memory, it means you are using luajit.

make sure to run ./clean.sh before ./install.sh

Also, when you run the install.sh command, make sure you see this line:
Installing Lua version: LUA52

@lorrp1
Copy link

lorrp1 commented Jun 17, 2018

still the same error

very sad since its the only stuff id like to try

@lorrp1
Copy link

lorrp1 commented Jun 25, 2018

do you have lua 5.2.4?

ok i really dont know what i have done ( i have reinstalled torch and run lua install 5.3 instead of 5.2) but know i have managed to go through the error to get stuck on another one:

Generating data ...
...
resolve time: 48.398242950439
/home/painkillerrr/torch/install/bin/lua: cannot open <../Data/TrainSamples/NoLimit/1529964083-7h3cThKcKd-1.inputs> in mode w at /home/painkillerrr/torch/pkg/torch/lib/TH/THDiskFile.c:673
...

@happypepper
Copy link
Owner

No, I'm using lua 5.2.3 but 5.2.4 should work also.

Can you paste what error you got after re-installing torch with the new tensormath.lua files?

@lorrp1
Copy link

lorrp1 commented Jun 25, 2018

ok i really dont know what i have done ( i have reinstalled torch and run lua install 5.3 instead of 5.2) but know i have managed to go through the error to get stuck on another one:

Generating data ...
...
resolve time: 48.398242950439
/home/painkillerrr/torch/install/bin/lua: cannot open <../Data/TrainSamples/NoLimit/1529964083-7h3cThKcKd-1.inputs> in mode w at /home/painkillerrr/torch/pkg/torch/lib/TH/THDiskFile.c:673
...

the is no folder in data callaed trainsample

@happypepper
Copy link
Owner

happypepper commented Jun 26, 2018

That is good news, it means it succeeded in generating the data.

There is a problem in writing the data file.
You need to create a NoLimit folder inside TrainSamples otherwise it will fail to write to any files.

@lorrp1
Copy link

lorrp1 commented Jun 26, 2018

im pretty sure: TORCH_LUA_VERSION=LUA52 ./install.sh
fixed even this issue.

@happypepper

how did you you managed to make deepholdem play vs "Slumbot 2017"??

@lh14576
Copy link

lh14576 commented Nov 3, 2018

I can't get around this scatterAdd issue.
Generating data ... /root/torch/install/bin/lua: ./Game/card_tools.lua:30: attempt to call a nil value (method 'scatterAdd') stack traceback: ./Game/card_tools.lua:30: in function 'Game.card_tools.get_possible_hands_mask' ./Game/Evaluation/evaluator.lua:137: in function 'Game.Evaluation.evaluator.evaluate_fast' (...tail calls...) ./TerminalEquity/terminal_equity.lua:74: in method 'get_last_round_call_matrix' ./TerminalEquity/terminal_equity.lua:179: in method '_set_call_matrix' ./TerminalEquity/terminal_equity.lua:217: in method 'set_board' ./DataGeneration/data_generation.lua:58: in function 'DataGeneration.data_generation.generate_data_file' ./DataGeneration/data_generation.lua:24: in function 'DataGeneration.data_generation.generate_data' DataGeneration/main_data_generation.lua:14: in main chunk [C]: in function 'dofile' /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: in ?

I got it running on a google compute engine. But it just doesn't work locally. I have reinstalled torch a couple of times (5.2 and 5.3) and made sure the modified TensorMath.lua files were in place beforehand. I am out of ideas now.
It's working with CPU though.

EDIT: just solved the issue. Running install.sh as sudo helped.

@dcarnino
Copy link

@lh14576 I have the exact same error. With the modified TensorMath.lua files, it works on CPU but not on GPU.
Any specific thing you did apart from running install.sh as sudo? (I ran everything as root)

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

5 participants