Re: [theano-users] Pygpu Invalid Values / Options Error

2018-11-04 Thread John Coolidge
Thanks Arnaud -- that would actually make a lot of sense!  I've tried CUDA 
9.2 as 10.0 is not available through Anaconda, but I'll try a manual 
install of CUDA 10.

On Sunday, November 4, 2018 at 8:42:06 PM UTC-8, Arnaud Bergeron wrote:
>
> This seems like you don’t have a version of CUDA that supports your GPU. 
>  The 2080 requires CUDA 10. What version is installed?
>
> Le 3 nov. 2018 à 00:03, John Coolidge > 
> a écrit :
>
> I've had trouble getting Theano to work on my GPU and tracked down the 
> error to pygpu.  When I run PyGPU's python tests it fails with 4506 
> errors.  All of the error messages have a common theme of some sort of 
> invalid or unrecognized option being set.  For example I see a lot of 
> "GpuArrayException: nvrtcCompileProgram: NVRTC_ERROR_INVALID_OPTION" from 
> gpuarray.pyx, line 406 and "GpuArrayException: CUDA kernel compile failure 
> ... NVRTC compile log::nvrtc: error: invalid value for --gpu-architecture 
> (-arch)" from gpuarray.pyx, line 446
>
> I'm running Ubuntu 18.04 with an NVIDIA Geforce 2080 card, driver version 
> 410.73.  I installed pygpu with anaconda and listing the anaconda packages 
> for my current environment gives:
> # NameVersion   Build  Channel
> blas  1.0 mkl  
> bzip2 1.0.6h14c3975_5  
> ca-certificates   2018.03.070  
> certifi   2018.10.15   py27_0  
> cmake 3.12.2   h52cb24c_0  
> cudatoolkit   9.2   0  
> expat 2.2.6he6710b0_0  
> intel-openmp  2019.0  118  
> libcurl   7.61.1   h20c2e04_0  
> libedit   3.1.20170329 h6b74fdf_2  
> libffi3.2.1hd88cf55_4  
> libgcc-ng 8.2.0hdf63c60_1  
> libgfortran-ng7.3.0hdf63c60_0  
> libgpuarray   0.7.6h14c3975_0  
> libstdcxx-ng  8.2.0hdf63c60_1  
> mako  1.0.7py27_0  
> markupsafe1.0  py27h14c3975_1  
> mkl   2019.0  118  
> mkl_fft   1.0.6py27h7dd41cf_0  
> mkl_random1.0.1py27h4414c95_1  
> ncurses   6.1  hf484d3e_0  
> nose  1.3.7py27_2  
> numpy 1.15.3   py27h1d66e8a_0  
> numpy-base1.15.3   py27h81de0dd_0  
> openssl   1.1.1h7b6447c_0  
> pip   18.1 py27_0  
> pygpu 0.7.6py27h035aef0_0  
> python2.7.15   h9bab390_2  
> readline  7.0  h7b6447c_5  
> rhash 1.3.6h1ba5d50_0  
> setuptools40.5.0   py27_0  
> six   1.11.0   py27_1  
> sqlite3.25.2   h7b6447c_0  
> tk8.6.8hbc83047_0  
> wheel 0.32.2   py27_0  
> xz5.2.4h14c3975_4  
> zlib  1.2.11   ha838bed_2 
>
> Anyone have any ideas what the problem could be?
>
> -- 
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to theano-users...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 

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


[theano-users] Pygpu Invalid Values / Options Error

2018-11-02 Thread John Coolidge
I've had trouble getting Theano to work on my GPU and tracked down the 
error to pygpu.  When I run PyGPU's python tests it fails with 4506 
errors.  All of the error messages have a common theme of some sort of 
invalid or unrecognized option being set.  For example I see a lot of 
"GpuArrayException: nvrtcCompileProgram: NVRTC_ERROR_INVALID_OPTION" from 
gpuarray.pyx, line 406 and "GpuArrayException: CUDA kernel compile failure 
... NVRTC compile log::nvrtc: error: invalid value for --gpu-architecture 
(-arch)" from gpuarray.pyx, line 446

I'm running Ubuntu 18.04 with an NVIDIA Geforce 2080 card, driver version 
410.73.  I installed pygpu with anaconda and listing the anaconda packages 
for my current environment gives:
# NameVersion   Build  Channel
blas  1.0 mkl  
bzip2 1.0.6h14c3975_5  
ca-certificates   2018.03.070  
certifi   2018.10.15   py27_0  
cmake 3.12.2   h52cb24c_0  
cudatoolkit   9.2   0  
expat 2.2.6he6710b0_0  
intel-openmp  2019.0  118  
libcurl   7.61.1   h20c2e04_0  
libedit   3.1.20170329 h6b74fdf_2  
libffi3.2.1hd88cf55_4  
libgcc-ng 8.2.0hdf63c60_1  
libgfortran-ng7.3.0hdf63c60_0  
libgpuarray   0.7.6h14c3975_0  
libstdcxx-ng  8.2.0hdf63c60_1  
mako  1.0.7py27_0  
markupsafe1.0  py27h14c3975_1  
mkl   2019.0  118  
mkl_fft   1.0.6py27h7dd41cf_0  
mkl_random1.0.1py27h4414c95_1  
ncurses   6.1  hf484d3e_0  
nose  1.3.7py27_2  
numpy 1.15.3   py27h1d66e8a_0  
numpy-base1.15.3   py27h81de0dd_0  
openssl   1.1.1h7b6447c_0  
pip   18.1 py27_0  
pygpu 0.7.6py27h035aef0_0  
python2.7.15   h9bab390_2  
readline  7.0  h7b6447c_5  
rhash 1.3.6h1ba5d50_0  
setuptools40.5.0   py27_0  
six   1.11.0   py27_1  
sqlite3.25.2   h7b6447c_0  
tk8.6.8hbc83047_0  
wheel 0.32.2   py27_0  
xz5.2.4h14c3975_4  
zlib  1.2.11   ha838bed_2 

Anyone have any ideas what the problem could be?

-- 

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


[theano-users] Re: Implementing a GPU op

2017-07-19 Thread John Coolidge
Oh man, so glad I randomly clicked on your your message! I just wrote a 
post about the same problem, except I was getting the segmentation fault 
while simply trying to run some old code on the GPU with the new GPU 
backend.  I also use anaconda and using the init_gpu_device flag instead of 
the ordinary device flag as well as downgrading pygpu and libgpuarray also 
solved my problem. Not sure if the problem lies with Theano, but seems like 
this could affect a fair number of people.


On Sunday, July 16, 2017 at 4:15:51 AM UTC-7, Christopher Bourez wrote:
>
> Moreover if you install Theano from scratch :
>
> conda install theano pygpu
>
> Fetching package metadata .
> Solving package specifications: .
>
> Package plan for installation in environment /root/miniconda2:
>
> The following NEW packages will be INSTALLED:
>
> libgpuarray: 0.6.8-0 
> pygpu:   0.6.8-py27_0
> theano:  0.9.0-py27_0
>
>
> you need to run the following correction after :
>
> conda install libgpuarray=0.6.4-0 pygpu=0.6.4
>
>
> And now that works on the server I was initially working on. 
>
>

-- 

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


[theano-users] New GPUArray Related Crash

2017-07-19 Thread John Coolidge
Theano version 0.90 is crashing python on my system (Ubuntu 14.04) with the 
following error message: "Process finished with exit code 139 (interrupted 
by signal 11: SIGSEGV)" .  This crash happens when I do theano.test(). 
Theano also similarly crashes when I call theano.function() in some 
personal code with device=cuda.  The code works fine when device=gpu or 
device=cpu.  Curiously, running the GPU test code from the documentation 
with device=cuda works fine. It may be useful to know that theano seems to 
successfully find my graphics card: "Mapped name None to device cuda: 
GeForce GTX 870M (:01:00.0)."  Is there some way to get more detailed 
information on the error?  Any idea what could be causing it?

-- 

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


Re: [theano-users] Theano.clone with Multiple Replacements

2016-10-14 Thread John Coolidge
I see, thanks Pascal!  Shame map_variables doesn't do the trick in this 
case.  I think I'll go with the manual approach you recommended as it seems 
the most efficient and relatively straight forward in my case.

On Friday, October 14, 2016 at 5:13:53 PM UTC-7, Pascal Lamblin wrote:
>
> On Sat, Oct 15, 2016, Pascal Lamblin wrote: 
> > Another option, still experimental, may be the `map_variables` function 
> > in scan_modules/scan_utils. 
>
> There seem to be some challenges regarding scalar constants with that 
> function, but I was able to do the following: 
>
> >>> theano.tensor.basic.constant.enable = False 
> >>> v = theano.tensor.lscalar('v') 
> >>> exp1 = 2 * v 
> >>> exp1.name = 'exp1' 
> >>> exp2 = 4 * exp1 
> >>> exp2.name = 'exp2' 
> >>> exp3 = 6 * exp2 
> >>> exp3.name = 'exp3' 
> >>> exp4 = 8 * exp3 
> >>> exp4.name = 'exp4' 
> >>> replace_dict = {'exp1': (3*exp1), 'exp2': (5*exp2), 'exp3': (7*exp3)} 
> >>> def replace(var): 
> ... return replace_dict.get(var.name, var) 
> >>> exp5, = theano.scan_module.scan_utils.map_variables(replace, [exp4]) 
> >>> theano.printing.debugprint(exp5) 
> Elemwise{mul,no_inplace} [id A] 'exp4'   
>  |TensorConstant{8} [id B] 
>  |Elemwise{mul,no_inplace} [id C] ''   
>|TensorConstant{7} [id D] 
>|Elemwise{mul,no_inplace} [id C] ''   
>
> The issue is that it introduced a cycle in the graph: it replaced exp3 
> by 7*exp3, where exp3 is the new one... 
>
> I guess that illustrates the challenge of getting replacements right. 
>
> > 
> > Finally, it is actually possible to replace Apply nodes inputs manually. 
> > In your case, you could do something like: 
> > 
> > >>> exp2.owner.inputs[1] = 3*exp1 
> > >>> exp3.owner.inputs[1] = 5*exp2 
> > >>> exp4.owner.inputs[1] = 7*exp3 
> > >>> print(theano.pp(exp4)) 
> > (TensorConstant{8} * (TensorConstant{7} * (TensorConstant{6} * 
> (TensorConstant{5} * (TensorConstant{4} * (TensorConstant{3} * 
> (TensorConstant{2} * <TensorType(int64, scalar)>))) 
> > >>> exp4.eval({v: 1}) 
> > array(40320) 
> > 
> > But it can get hard to get right if the same expression is re-used 
> > several times. 
> > 
> > On Fri, Oct 14, 2016, John Coolidge wrote: 
> > > Hello, 
> > > 
> > > I'm trying to use theano.clone to implement dropout in my MLP network. 
> > >  Because I want to apply dropout at multiple layers, I pass the clone 
> call 
> > > multiple key value pairs to its replacement parameter: 
> > > replace={layer1:mask*layer1, layer2:mask*layer2, etc} however the 
> graph 
> > > that's returned seems to have only actually made one of the 
> replacements. 
> > >  I suspect this is because clone is doing the replacements 
> sequentially and 
> > > once it's done one replacement it generates a new graph for which the 
> other 
> > > key value pairs no longer correspond. 
> > > 
> > > Here is some example code that demonstrates the unexpected behavior: 
> > > 
> > > v = T.lscalar() 
> > > exp1 = 2*v 
> > > exp2 = 4*exp1 
> > > exp3 = 6*exp2 
> > > exp4 = 8*exp3 
> > > 
> > > print theano.pp(exp4) 
> > > exp5 = theano.clone(exp4, replace={exp1:(3*exp1), exp2:(5*exp2), 
> > > exp3:(7*exp3)}) 
> > > print theano.pp(exp5) 
> > > t = theano.function(inputs=[v], outputs=exp5) 
> > > print t(1) 
> > > 
> > > 
> > > The output is: 
> > > (TensorConstant{8} * (TensorConstant{6} * (TensorConstant{4} * 
> > > (TensorConstant{2} * <TensorType(int64, scalar)> 
> > > (TensorConstant{8} * (TensorConstant{7} * (TensorConstant{6} * 
> > > (TensorConstant{4} * (TensorConstant{2} * <TensorType(int64, 
> scalar)>) 
> > > 2688 
> > > 
> > > Although the clone adds the 7 factor to the new graph, it does not add 
> the 
> > > 3 or 5 factors such that the output for an input value of 1 is 
> 8*7*6*4*2*1 
> > > instead of 8! as I would have expected. 
> > > 
> > > I'm guessing this is how the clone function is supposed to work, but 
> does 
> > > anyone see how to get the desired behavior I'm looking for?  Perhaps I 
> > > could apply the replacements one at a time and after each replacement 
> > > update the remaining replacement key value pairs to point to 
> corresponding 
> > > poin

[theano-users] Theano.clone with Multiple Replacements

2016-10-14 Thread John Coolidge
Hello,

I'm trying to use theano.clone to implement dropout in my MLP network. 
 Because I want to apply dropout at multiple layers, I pass the clone call 
multiple key value pairs to its replacement parameter: 
replace={layer1:mask*layer1, layer2:mask*layer2, etc} however the graph 
that's returned seems to have only actually made one of the replacements. 
 I suspect this is because clone is doing the replacements sequentially and 
once it's done one replacement it generates a new graph for which the other 
key value pairs no longer correspond.

Here is some example code that demonstrates the unexpected behavior:

v = T.lscalar()
exp1 = 2*v
exp2 = 4*exp1
exp3 = 6*exp2
exp4 = 8*exp3

print theano.pp(exp4)
exp5 = theano.clone(exp4, replace={exp1:(3*exp1), exp2:(5*exp2), 
exp3:(7*exp3)})
print theano.pp(exp5)
t = theano.function(inputs=[v], outputs=exp5)
print t(1) 


The output is:
(TensorConstant{8} * (TensorConstant{6} * (TensorConstant{4} * 
(TensorConstant{2} * 
(TensorConstant{8} * (TensorConstant{7} * (TensorConstant{6} * 
(TensorConstant{4} * (TensorConstant{2} * )
2688

Although the clone adds the 7 factor to the new graph, it does not add the 
3 or 5 factors such that the output for an input value of 1 is 8*7*6*4*2*1 
instead of 8! as I would have expected.

I'm guessing this is how the clone function is supposed to work, but does 
anyone see how to get the desired behavior I'm looking for?  Perhaps I 
could apply the replacements one at a time and after each replacement 
update the remaining replacement key value pairs to point to corresponding 
points in the new graph, but I'm not sure how to find these corresponding 
points.  Or perhaps there's a function like the clone but that actually 
makes the replacements in place so that the other replacement key value 
pairs would not be invalidated after the first replacement?  Any ideas 
would be greatly appreciated!

-- 

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