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

Links or load problem about qt #15

Closed
russellfei opened this issue Jan 24, 2015 · 21 comments
Closed

Links or load problem about qt #15

russellfei opened this issue Jan 24, 2015 · 21 comments

Comments

@russellfei
Copy link

Qt based console offers such a easy to display convolutional kernels
(--> what I realized several days ago 0_0, thanks @culurciello 's video on youtube)

torch configuration

  • soumith/torch-distro
  • manually installed deps according to torch/ezinstall
  • platform: OS X 10.9
  • python with pip installed ipython

installation overview:

  • build success
  • Path manually revised to .bash_profile (equivalent in .bashrc)
  • Qt installed with brew

test code

require 'image'
image.display(image.lena())

test output

Success binary tool:

  • qlua
  • macqlua

Error binary tool:

  • th
  • itorch ( cmd/notebook/qtconsole)
Error info:
th> require 'image'
true    
                                                                      [0.0054s]
th> image.display(image.lena())
...ltorch/torch-distro/install/share/lua/5.1/trepl/init.lua:319: module 'qt' not found:No LuaRocks module found for qt
    no field package.preload['qt']
    no file '/Users/russellfei/.luarocks/share/lua/5.1/qt.lua'
    no file '/Users/russellfei/.luarocks/share/lua/5.1/qt/init.lua'
    no file '/usr/local/mltorch/torch-distro/install/share/lua/5.1/qt.lua'
    no file '/usr/local/mltorch/torch-distro/install/share/lua/5.1/qt/init.lua'
    no file './qt.lua'
    no file '/usr/local/mltorch/torch-distro/install/share/luajit-2.1.0-alpha/qt.lua'
    no file '/usr/local/share/lua/5.1/qt.lua'
    no file '/usr/local/share/lua/5.1/qt/init.lua'
    no file '/Users/russellfei/.luarocks/lib/lua/5.1/qt.so'
    no file '/usr/local/mltorch/torch-distro/install/lib/lua/5.1/qt.so'
    no file './qt.so'
    no file '/usr/local/lib/lua/5.1/qt.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: in function 'error'
    ...ltorch/torch-distro/install/share/lua/5.1/trepl/init.lua:319: in function 'require'
    ...ltorch/torch-distro/install/share/lua/5.1/image/init.lua:945: in function 'display'
    [string "image.display(image.lena())"]:1: in main chunk
    [C]: in function 'xpcall'
    ...ltorch/torch-distro/install/share/lua/5.1/trepl/init.lua:588: in function 'repl'
    ...rch-distro/install/lib/luarocks/rocks/trepl/scm-1/bin/th:185: in main chunk
    [C]: at 0x01094eb610    

Summary

  • the success two binary tools show that this issue lies in the preload way of qt, I guess.
  • According to previous posts on Google Groups, this issue results from Qt4

Questions

  • What about Qt5? brew version has Qt5, or torch is only designed with Qt4?
  • brew install qt gives apps like QtDesigner, however, torch just connects to qt for visualization,
    which part of qt source/module does torch use? Can we link that path to th or so to directly use qt?
@culurciello
Copy link

;-)

@alexbw
Copy link
Contributor

alexbw commented Jan 24, 2015

The above steps, with small differences, works for me using your steps in qlua.
The differences are, I install dependencies before installing torch, and I use torch/distro (this repo) and not soumith/torch-distro. There aren't any changes between them that should affect this, though.

@russellfei
Copy link
Author

@alexbw but the soumith/torch-distro is directed to torch/distro (soumith authored that before torch/distro is released, so I kept typing that url to find it ;-)
qlua and macqlua works fine for me.
However, the other tools don't, that's quite strange.

@soumith
Copy link
Member

soumith commented Jan 24, 2015

@russellfei Qt interface only works in qlua! this is not at all an issue.
We have nothing in the works for Qt5. Lots of time and effort have to be invested, for something that might not be much of an addition.

@soumith soumith closed this as completed Jan 24, 2015
@russellfei
Copy link
Author

@soumith Well, in culuricello's video, there's some interface like torch qtconsole, but I didn't find identical one.

Question

according to what you said, how iTorch and th using image.display function?
Dependening on gfx.js?

So the image.display is overrided in different binary tools, isn't it?

@russellfei
Copy link
Author

Tested.
itorch use itorch.image(image.lena()) to display images.

@psabouri
Copy link

@russellfei I have same problem and I am unable to solve it. how did you overcome this problem? did you install another package to run itorch?

@russellfei
Copy link
Author

@psabouri sorry for late reply.
If you checked my note above, you should keep in mind that iTorch is based on both torch and ipython (actually penlight package should also be included, but it's installed by default).
You need to have ipython toolset installed first, and torch (Be patient to add your torch path to environment variables -- it is essential to make torch work)

If you still have any questions about torch, just reply here, ;-)

@jiangfeng15
Copy link

when I use (require 'qt'),it remind me that module 'qt' not found, but how to install qt, my system is ubuntu 14

@russellfei
Copy link
Author

try qlua if you followed scripts on torch/ezinstall (the easiest way to deploy torch ecosystem).
Otherwise, search ask ubuntu for how to install qt 4, there are plenty of helpful web pages.

@eriche2016
Copy link

qlua is the solution indeed

@Schrodinger1926
Copy link

I got that solution is to use qlua to execute my file but why doesn't qt work with 'th' interpreter ?? How do i display images with th interpreter??

@russellfei
Copy link
Author

@Mindboggler
If you want to display images with th, you should use other display utilities such as gfx.go
Or, you can use qlua.
th is just a cmd utility without display function.

@Schrodinger1926
Copy link

peace

@vrama91
Copy link

vrama91 commented Sep 27, 2015

@russellfei I have the same problem. I am using I Torch notebook, and trying out image.display(image.lena())
I get an error which says that "module 'qt' not found”. I verified that my itorch was using luajit and not the qt console. Is something wrong with my itorch setup? I am using anaconda python.

@soumith
Copy link
Member

soumith commented Sep 27, 2015

@ramakrishnavedantam928 read the itorch documentation. I dont see why you expect image.display to work in itorch?

@svkerr
Copy link

svkerr commented Jan 20, 2016

@Mindboggler Thanks - but how do i use qlua from within a torch script (filename.lua) that calls:
image.display(some_image)?

@Schrodinger1926
Copy link

If you want image.display to work in torch, you simply don't use $th filename.lua. You execute $qlua filename.lua . filename.lua will still be a torch script.

@svkerr
Copy link

svkerr commented Jan 21, 2016

Thanks @Mindboggler.

@christopher5106
Copy link

Thanks @russellfei

@yiran-THU
Copy link

Thanks @eriche2016

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