Getting Torch to work on a Raspberry PI 2

1,282 views
Skip to first unread message

Ajay Talati

unread,
Mar 26, 2015, 7:30:16 AM3/26/15
to tor...@googlegroups.com
I just wondered if anyone's interested in trying to get Torch working on a Raspberry Pi 2 - yes they do have a GPU :)

It looks do able as, some ones already got OpenGL and a LuaJIT package working for it, it's called LjES

Looks cute :)

Yossi Biton

unread,
Mar 26, 2015, 11:30:43 AM3/26/15
to tor...@googlegroups.com
pay attention that pi has only 1 GB ram, so you probably can't do cool staff with neural networks which usually weights more..

Ajay Talati

unread,
Mar 26, 2015, 11:57:51 AM3/26/15
to tor...@googlegroups.com
Yeah, I'm not expecting much

Just a couple of simple MLPs, logistic regression, and maybe autoencoders & very simple reinforcement learning to start with - just nice for kids to play with :)))

Lua should be easy for kids to understand, especially with the interpreter.

Children would find it quite magical, if they programmed it themselves :)

Also if they start using big networks, they probably would'nt understand what's going on anyway.

Pedro Tabacof

unread,
Mar 26, 2015, 12:25:43 PM3/26/15
to torch7 on behalf of Ajay Talati
1GB is more than enough to handle OverFeat, which has over 140 million weights.

I'm also interested to embed Torch7 on a Raspberry Pi, but I have no time for it right now.

Pedro.

--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at http://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.



--
Pedro Tabacof

Eugenio Culurciello

unread,
Mar 26, 2015, 12:42:06 PM3/26/15
to tor...@googlegroups.com
1GB is quite enough for a lot of state of art usage.
This is enough memory for all our state of art networks at teradeep inc.

I also recommend you to loo at the odroid c1 and u3 units

E

Ajay Talati

unread,
Mar 26, 2015, 1:21:15 PM3/26/15
to tor...@googlegroups.com
Hi Eugenio,

thanks for the heads up :)

Yes, it seems ODROID boards you recommended will take less work to get things going:)

THANKS A LOT!

Tushar N

unread,
Oct 20, 2015, 4:04:19 PM10/20/15
to torch7
Hi,
A project I'm working on would also be helped if torch can run on a Raspberry Pi (Just some simple models with images generated by the RPI camera module.)
Have any of you tried compiling torch on the RPi? Or using the Odroid board that Eugenio suggested?

-Tushar 

Mike McWilliams

unread,
Dec 31, 2015, 8:02:58 PM12/31/15
to torch7
I'm trying because I want to get the teradeep demo going. I'm failing on dependencies for the install and can't overcome that issue. The latest in a long chain is that luaffi is missing. Then it fails on a missing call_arm.h 

Mike McWilliams

unread,
Dec 31, 2015, 11:58:25 PM12/31/15
to torch7
Missing dependencies for nn:
luaffi

Cloning into 'luaffifb'...
remote: Counting objects: 42, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 42 (delta 4), reused 23 (delta 2), pack-reused 0
Receiving objects: 100% (42/42), 147.40 KiB, done.
Resolving deltas: 100% (4/4), done.
gcc -O2 -fPIC -I/home/pi/torch/install/include -c call.c -o call.o -Idynasm
In file included from call.c:47:0:
call_arm.dasc:19:64: error: unknown type name âfunction_tâ
 static void compile_extern_jump(struct jit* jit, lua_State* L, function_t func, uint8_t* code)
                                                                ^
call_arm.dasc:55:1: error: unknown type name âfunction_tâ
 function_t push_callback(struct jit* jit, lua_State* L, int fidx, int ct_usr, const struct ctype* ct)
 ^
call_arm.dasc:55:12: error: conflicting types for âpush_callbackâ
 function_t push_callback(struct jit* jit, lua_State* L, int fidx, int ct_usr, const struct ctype* ct)
            ^
In file included from call.c:9:0:
ffi.h:402:6: note: previous declaration of âpush_callbackâ was here
 void push_callback(lua_State* L, cfunction luafunc, cfunction cfunc);
      ^
In file included from call.c:47:0:
call_arm.dasc: In function âpush_callbackâ:
call_arm.dasc:121:18: error: âUINT64_TYPEâ undeclared (first use in this function)
             case UINT64_TYPE:
                  ^
call_arm.dasc:121:18: note: each undeclared identifier is reported only once for each function it appears in
In file included from call.c:47:0:
call_arm.dasc:135:18: error: âUINTPTR_TYPEâ undeclared (first use in this function)
             case UINTPTR_TYPE:
                  ^
In file included from call.c:47:0:
call_arm.dasc:161:18: error: âUINT8_TYPEâ undeclared (first use in this function)
             case UINT8_TYPE:
                  ^
In file included from call.c:47:0:
call_arm.dasc:176:18: error: âUINT16_TYPEâ undeclared (first use in this function)
             case UINT16_TYPE:
                  ^
In file included from call.c:47:0:
call_arm.dasc:191:18: error: âUINT32_TYPEâ undeclared (first use in this function)
             case UINT32_TYPE:
                  ^
In file included from call.c:47:0:
call_arm.dasc:336:9: error: unknown type name âfunction_tâ
         function_t func;
         ^
call_arm.dasc:338:14: warning: assignment makes integer from pointer without a cast [enabled by default]
         func = compile(jit, L, NULL, ref);
              ^
call_arm.dasc:343:11: error: âfunction_tâ undeclared (first use in this function)
         *(function_t*) p = func;
           ^
call_arm.dasc:343:22: error: expected expression before â)â token
         *(function_t*) p = func;
                      ^
call_arm.dasc: At top level:
call_arm.dasc:351:51: error: unknown type name âfunction_tâ
 void push_function(struct jit* jit, lua_State* L, function_t func, int ct_usr, const struct ctype* ct)
                                                   ^

Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/luaffi-scm-1.rockspec - Build error: Failed compiling object call.o
 

My current errors

Any help would be hot

Eugenio Culurciello

unread,
Jan 4, 2016, 11:15:00 AM1/4/16
to torch7
You can also try to use this lib:
https://github.com/mvitez/thnets
it is a lot easier to use for embedded systems, and works with models like this one:



On Thursday, March 26, 2015 at 7:30:16 AM UTC-4, Ajay Talati wrote:

After Sight

unread,
Jan 4, 2016, 11:30:34 AM1/4/16
to Eugenio Culurciello via torch7

Just prior to getting your response a guy we have been working with in the raspberry pi forums got teradeep working with all the other software we have going and has a good install of torch.

We will evaluate what he has going first, but I will absolutely follow up with what you just provided.

We are hoping to achieve at least 1/s framerates as the nearest similar software we have running (jetpac)‎ is about 1/5 seconds.

As we are using it with blind people we have to read back the results and that takes time, so there is no need for 15fps. However I can see the value in averaging confidence values for an object if you have higher framerates and then using those averages for the spoken interval.

We will let you know our progress. 

Thanks,
--
You received this message because you are subscribed to a topic in the Google Groups "torch7" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/torch7/zJX-EUOISBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to torch7+un...@googlegroups.com.

To post to this group, send email to tor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages