Skip to content

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

@johannaflato

Description

@johannaflato

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions