jcjohnson / torch-rnn

Efficient, reusable RNNs and LSTMs for torch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

johannaflato opened this issue · comments

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 ?

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