Showing posts with label torch. Show all posts
Showing posts with label torch. Show all posts

Wednesday, April 12, 2017

How to install luasql on Linux Ubuntu 16?

Leave a Comment

Thanks to the help of the StackOverflow community, I was able to correctly install luasql on my computer running Linux CentOS 7.

Now I have a similar problem on Linux Ubuntu 16. I tried the following commands:

sudo apt-get -y install lua-sql-postgres sudo apt-get -y install lua-sql-postgres-dev sudo luarocks install luasql-postgres 

And here's the error I get from the system:

Installing https://rocks.moonscript.org/luasql-postgres-2.3.5-2.rockspec... Using https://rocks.moonscript.org/luasql-postgres-2.3.5-2.rockspec... switching to 'build' mode  Error: Could not find expected file libpq-fe.h, or libpq-fe.h for PGSQL -- you may have to install PGSQL in your system and/or pass PGSQL_DIR or PGSQL_INCDIR to the luarocks command. Example: luarocks install luasql-postgres PGSQL_DIR=/usr/local 

Does anyone know how to solve this problem? Thanks

2 Answers

Answers 1

As suggested by @Knud Larsen first you need to install libpq-dev.

If it was installed sussecfully then you can see file /usr/include/postgresql/libpq-fe.h

After that try below command.

sudo luarocks PGSQL_INCDIR=/usr/include/postgresql/ install luasql-postgres

Answers 2


Please install the package libpq-dev :

The file libpq-fe.h is in /usr/include/postgresql/ http://packages.ubuntu.com/xenial-updates/amd64/libpq-dev/filelist

Read More

Tuesday, August 2, 2016

In Torch / Lua, how to implement a probabilistic neural network?

Leave a Comment

I've been studying this artificial neural network model called probabilistic neural network. I think I understood the general idea, but I cannot understand how to implement it in Torch.

Does anyone know how to implement a probabilistic neural network in Torch?

0 Answers

Read More

Friday, May 6, 2016

Writing Tables in Torch to file

Leave a Comment

I am trying to save some tables of strings to files in Torch. I have tried using this Torch extension by Deepmind: hdf5.

require 'hdf5' label = {'a', 'b','c','d'}  local myFile = hdf5.open(features_repo .. 't.h5', 'w') myFile:write('label', label) myFile:close() 

I am getting the error:

/home/user/torch/install/bin/luajit: ...e/user/torch/install/share/lua/5.1/hdf5/group.lua:222: torch-hdf5: writing data of type string is not supported 

Torch Tensors are written to file as intended.

I have also tried using matio to write to mat files (for MatLab). I am getting this error:

bad argument #1 to 'varCreate' (cannot convert 'number' to 'const char *') 

0 Answers

Read More

Wednesday, April 27, 2016

Installing Torch Extension fb-caffe-exts from github

Leave a Comment

I am a new Torch user. How do you install the fb-caffe-exts extension for Torch from Github? fb-caffe-exts

0 Answers

Read More

Sunday, March 6, 2016

Torch install without curl

Leave a Comment

I need to install Torch on server,

but its installation guide requires the following line as the first step:

curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash 

curl is not installed on my server, and I'm not the root, so I don't have permission to install it.

I downloaded the script file in the URL, and chmod-ed it,

but can't execute it, again due to permission.

Is there a way to install torch without usage of curl?

bash install-deps  

resulted in

xxxx is not in the sudoers file. This incident will be reported. 

1 Answers

Answers 1

Torch dependencies needs to be installed - if you install it via this script, that'll require root privileges.

If you saved the script, you can start it (without chmod) with

bash install-deps 
Read More