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

./util/utils.lua:43: attempt to index local 'f' (a nil value) #224

Open
johannaflato opened this issue May 18, 2018 · 1 comment
Open

./util/utils.lua:43: attempt to index local 'f' (a nil value) #224

johannaflato opened this issue May 18, 2018 · 1 comment

Comments

@johannaflato
Copy link

johannaflato commented May 18, 2018

Hi, I'm running MacOS 10.13.4 (CPU-mode) and when I execute train.lua I see the following error:

/Users//torch/install/bin/luajit: ./util/utils.lua:43: attempt to index local 'f' (a nil value)
stack traceback:
./util/utils.lua:43: in function 'read_json'
train.lua:77: in main chunk
[C]: in function 'dofile'
...lato/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x010f1dacc0

This is the referenced code snippet:

function utils.read_json(path) local f = io.open(path, 'r') local s = f:read('*all') f:close() return cjson.decode(s) end

Does anyone have any idea how to remedy this? Any and all help appreciated...I am new to this. @jcjohnson ?

@danieleghisi
Copy link

danieleghisi commented Jul 31, 2018

Hi, as far as I can tell, that issue happens when the path you set for the json file is incorrect.

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

2 participants