andyzeng / arc-robot-vision

MIT-Princeton Vision Toolbox for Robotic Pick-and-Place at the Amazon Robotics Challenge 2017 - Robotic Grasping and One-shot Recognition of Novel Objects with Deep Learning.
http://arc.cs.princeton.edu
Apache License 2.0
296 stars 98 forks source link

can't train the net of Suction-Based Grasping #1

Closed changhai0551 closed 6 years ago

changhai0551 commented 6 years ago

When I run the training command th train.lua of the Suction-Based Grasping, it outputs the error as follows: /home/robot/Downloads/torch/install/bin/luajit: ./DataLoader.lua:22: attempt to call global 'getLinesFromFile' (a nil value) stack traceback: ./DataLoader.lua:22: in function '__init' ...bot/Downloads/torch/install/share/lua/5.1/torch/init.lua:91: in function <...bot/Downloads/torch/install/share/lua/5.1/torch/init.lua:87> [C]: in function 'DataLoader' train.lua:37: in main chunk [C]: in function 'dofile' ...oads/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00405e40 how to fix the problem? Thanks!

mzh19940817 commented 6 years ago

I met the same problem when I ran "th train.lua" of the Parallel-Jaw-Grasping. Did you work it out?

andyzeng commented 6 years ago

Does adding require 'util' to the top of DataLoader.lua fix your problem?

mzh19940817 commented 6 years ago

@andyzeng It doesn't work. The problems are same as before. Which version of lua are you using?

mzh19940817 commented 6 years ago

@changhai0551 Does it fix your problem?

changhai0551 commented 6 years ago

@andyzeng @mzh19940817 It doesn't work for me either. The problems are same as before.

changhai0551 commented 6 years ago

I don't know the reason for the error, but just copying the required functions in util.lua to train.lua is useful.

andyzeng commented 6 years ago

My Lua version is 5.1. I'm also unsure why getLinesFromFile in util.lua is not found. What's your OS, GPU, and Lua version? I will try to see if I can reproduce the error.

mzh19940817 commented 6 years ago

Just like changhai0551 said, it's useful to copy function "getLinesFromFile", "fileExists" and "shuffleTable" in util.lua to train.lua. It seems that require 'util' doesn't work. I'm running Ubuntu 16.04 with Quadro K620(2Gb) and my lua version is also 5.1. I have solved my problems by using other computer(GTX 1050Ti with 4Gb memories). I changed the batch size from 2 to 1 and I found it consumed 2483Mb's memories.

mzh19940817 commented 6 years ago

It turned out to be the small GPU's memory. But if I want to run it with my GPU, how to modify the network architecture from "resnet-101.t7" to "resnet-50.t7"? I got errors as follow. 1

andyzeng commented 6 years ago

Interesting, I wonder if this error is related to your previous one where the imports are not working properly. Does it work if you copy paste utils and its functions from modelUtils.lua into model.lua?

mzh19940817 commented 6 years ago

It doesn't work. I'm ready to buy a new GPU card. Thanks for your help.

tcl326 commented 6 years ago

So I figured out why this was the problem. It seems to be that there is already a util library/package installed using luarocks. So when you require 'util' you are importing the 'util' package that you have installed, not the local util.lua file. This issue can be fixed by simply making the files to require 'util.lua' instead of only 'util'