Giter Club home page Giter Club logo

Comments (5)

ilkerkesen avatar ilkerkesen commented on August 17, 2024

I think you need to call Pkg.build("Knet") after you clone the repository. Could you try this?

from knet.jl.

ngphuoc avatar ngphuoc commented on August 17, 2024

Sure. It still has reduced_dims error. Below are the results:

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.1-pre+31 (2016-11-17 17:50 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 6a1e339ac* (84 days old release-0.5)
|__/                   |  x86_64-pc-linux-gnu

julia> Pkg.clone("https://github.com/denizyuret/Knet.jl")
INFO: Initializing package repository /home/phuoc/.julia/v0.5
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
INFO: Cloning Knet from https://github.com/denizyuret/Knet.jl
INFO: Computing changes...
INFO: Cloning cache of AutoGrad from https://github.com/denizyuret/AutoGrad.jl.git
INFO: Installing AutoGrad v0.0.4
INFO: Package database updated

julia> Pkg.build("Knet")
INFO: Building Knet
julia cuda1.jl > cuda1.cu
INFO: Knet using GPU 0
nvcc -c -O3 -use_fast_math -Wno-deprecated-gpu-targets --compiler-options -fPIC cuda1.cu -o cuda1.o
julia cuda01.jl > cuda01.cu
INFO: Knet using GPU 0
nvcc -c -O3 -use_fast_math -Wno-deprecated-gpu-targets --compiler-options -fPIC cuda01.cu -o cuda01.o
julia cuda11.jl > cuda11.cu
INFO: Knet using GPU 0
nvcc -c -O3 -use_fast_math -Wno-deprecated-gpu-targets --compiler-options -fPIC cuda11.cu -o cuda11.o
julia cuda12.jl > cuda12.cu
INFO: Knet using GPU 0
nvcc -c -O3 -use_fast_math -Wno-deprecated-gpu-targets --compiler-options -fPIC cuda12.cu -o cuda12.o
julia cuda20.jl > cuda20.cu
INFO: Knet using GPU 0
nvcc -c -O3 -use_fast_math -Wno-deprecated-gpu-targets --compiler-options -fPIC cuda20.cu -o cuda20.o
julia cuda21.jl > cuda21.cu
INFO: Knet using GPU 0
nvcc -c -O3 -use_fast_math -Wno-deprecated-gpu-targets --compiler-options -fPIC cuda21.cu -o cuda21.o
nvcc -O3 -use_fast_math -Wno-deprecated-gpu-targets --shared --compiler-options -fPIC cuda1.o cuda01.o cuda11.o cuda12.o cuda20.o cuda21.o -o libknet8.so

julia> Pkg.test("Knet")
INFO: Testing Knet
INFO: Knet using GPU 0
(:epoch,0,:loss,461.77524366804886)
(:epoch,1,:loss,3.3320559275652433)
(:epoch,2,:loss,0.1199614974011731)
(:epoch,3,:loss,0.005568748814864047)
(:epoch,4,:loss,0.0012351227916297506)
(:epoch,5,:loss,0.0010684746173929085)
(:epoch,6,:loss,0.00109180688895586)
(:epoch,7,:loss,0.001015281814462818)
(:epoch,8,:loss,0.0010581459658679027)
(:epoch,9,:loss,0.0010342780204682569)
(:epoch,10,:loss,0.0010601555948864918)
  1.048726 seconds (1.38 M allocations: 455.965 MB, 8.66% gc time)
INFO: Knet tests passed

julia> 
0 ~ cd .julia/v0.5/Knet/examples 
0 ~/.j/v/K/examples git:(master) ls
charlm.jl   housing.jl         lenet.jl   mnist.jl       resnet.jl       vgg.jl
deprecated  julia-tutorial.jl  linreg.jl  optimizers.jl  runexamples.jl
0 ~/.j/v/K/examples git:(master) julia runexamples.jl 
INFO: Knet using GPU 0
INFO: Testing Knet
INFO: Knet using GPU 0
(:epoch,0,:loss,461.77524366804886)
(:epoch,1,:loss,3.3320559275652433)
(:epoch,2,:loss,0.1199614974011731)
(:epoch,3,:loss,0.005568748814864047)
(:epoch,4,:loss,0.0012351227916297506)
(:epoch,5,:loss,0.0010684746173929085)
(:epoch,6,:loss,0.00109180688895586)
(:epoch,7,:loss,0.001015281814462818)
(:epoch,8,:loss,0.0010581459658679027)
(:epoch,9,:loss,0.0010342780204682569)
(:epoch,10,:loss,0.0010601555948864918)
  1.073738 seconds (1.38 M allocations: 455.965 MB, 8.59% gc time)
INFO: Knet tests passed
INFO: Cloning cache of ArgParse from https://github.com/carlobaldassi/ArgParse.jl.git
INFO: Cloning cache of Compat from https://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of TextWrap from https://github.com/carlobaldassi/TextWrap.jl.git
INFO: Installing ArgParse v0.4.0
INFO: Installing Compat v0.16.1
INFO: Installing TextWrap v0.1.6
INFO: Package database updated
linreg.jl (c) Deniz Yuret, 2016. Linear regression example with artificial data.
opts=(:lr,0.02)(:atype,"KnetArray")(:epochsize,10000)(:inputdims,100)(:noise,0.01)(:epochs,10)(:gcheck,2)(:seed,-1)(:outputdims,10)(:batchsize,20)(:fast,false)
(:epoch,0,:loss,207.71403130151853)
(:epoch,1,:loss,3.0070513621673327)
ERROR: LoadError: UndefVarError: gradcheck not defined
 in macro expansion at /home/phuoc/.julia/v0.5/Knet/examples/linreg.jl:102 [inlined]
 in macro expansion at ./util.jl:184 [inlined]
 in main(::String) at /home/phuoc/.julia/v0.5/Knet/examples/linreg.jl:98
 in macro expansion; at /home/phuoc/.julia/v0.5/Knet/examples/runexamples.jl:17 [inlined]
 in anonymous at ./<missing>:?
 in include_from_node1(::String) at ./loading.jl:488
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318
while loading /home/phuoc/.julia/v0.5/Knet/examples/runexamples.jl, in expression starting on line 6
0 ~/.j/v/K/examples git:(master) julia housing.jl 
INFO: Knet using GPU 0
housing.jl (c) Deniz Yuret, 2016. Linear regression model for the Housing dataset from the UCI Machine Learning
Repository.
opts=(:seed,-1)(:epochs,20)(:lr,0.1)(:atype,"KnetArray{Float32}")(:test,0.0)(:gcheck,0)(:fast,false)
INFO: Downloading https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data to /home/phuoc/.julia/v0.5/Knet/data/housing.data
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 49082  100 49082    0     0  35219      0  0:00:01  0:00:01 --:--:-- 35209
size(data) = (14,506)
(:epoch,0,:trn,592.7684f0,:tst,592.7684f0)
(:epoch,1,:trn,367.07144f0,:tst,367.07144f0)
(:epoch,2,:trn,241.88722f0,:tst,241.88722f0)
(:epoch,3,:trn,163.07997f0,:tst,163.07997f0)
(:epoch,4,:trn,112.86693f0,:tst,112.86693f0)
(:epoch,5,:trn,80.799904f0,:tst,80.799904f0)
(:epoch,6,:trn,60.288174f0,:tst,60.288174f0)
(:epoch,7,:trn,47.144394f0,:tst,47.144394f0)
(:epoch,8,:trn,38.7037f0,:tst,38.7037f0)
(:epoch,9,:trn,33.268185f0,:tst,33.268185f0)
(:epoch,10,:trn,29.755064f0,:tst,29.755064f0)
(:epoch,11,:trn,27.473152f0,:tst,27.473152f0)
(:epoch,12,:trn,25.98093f0,:tst,25.98093f0)
(:epoch,13,:trn,24.996094f0,:tst,24.996094f0)
(:epoch,14,:trn,24.338022f0,:tst,24.338022f0)
(:epoch,15,:trn,23.891035f0,:tst,23.891035f0)
(:epoch,16,:trn,23.580969f0,:tst,23.580969f0)
(:epoch,17,:trn,23.360214f0,:tst,23.360214f0)
(:epoch,18,:trn,23.198174f0,:tst,23.198174f0)
(:epoch,19,:trn,23.075119f0,:tst,23.075119f0)
(:epoch,20,:trn,22.978315f0,:tst,22.978315f0)
  0.808878 seconds (829.64 k allocations: 36.186 MB, 1.08% gc time)
0 ~/.j/v/K/examples git:(master) julia mnist.jl  
INFO: Cloning cache of GZip from https://github.com/JuliaIO/GZip.jl.git
INFO: Installing GZip v0.2.20
INFO: Package database updated
INFO: Knet using GPU 0
mnist.jl (c) Deniz Yuret, 2016. Multi-layer perceptron model on the MNIST handwritten digit recognition problem from http://yann.lecun.com/exdb/mnist.
opts=(:seed,-1)(:batchsize,100)(:hidden,Int64[])(:epochs,10)(:lr,0.5)(:atype,"KnetArray{Float32}")(:gcheck,0)(:winit,0.1)(:fast,false)
INFO: Loading MNIST...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9680k  100 9680k    0     0  1389k      0  0:00:06  0:00:06 --:--:-- 2047k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1610k  100 1610k    0     0   366k      0  0:00:04  0:00:04 --:--:--  366k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 28881  100 28881    0     0  41814      0 --:--:-- --:--:-- --:--:-- 41795
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4542  100  4542    0     0   9828      0 --:--:-- --:--:-- --:--:--  9809
ERROR: LoadError: MethodError: no method matching reduced_dims(::Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}, ::Int64)
Closest candidates are:
  reduced_dims(!Matched::Tuple{}, ::Int64) at reducedim.jl:70
  reduced_dims(!Matched::AbstractArray{T,N}, ::Any) at reducedim.jl:6
  reduced_dims(!Matched::Tuple{}, ::Any) at reducedim.jl:73
  ...
 in reduced_dims(::Tuple{Int64,Int64}, ::Int64) at ./reducedim.jl:75
 in sum(::Knet.KnetArray{Float32,2}, ::Int64) at /home/phuoc/.julia/v0.5/Knet/src/reduction.jl:29
 in accuracy(::Array{Any,1}, ::Array{Any,1}, ::MNIST.#predict) at /home/phuoc/.julia/v0.5/Knet/examples/mnist.jl:65
 in (::MNIST.#report#9)(::Int64) at /home/phuoc/.julia/v0.5/Knet/examples/mnist.jl:142
 in main(::Array{String,1}) at /home/phuoc/.julia/v0.5/Knet/examples/mnist.jl:146
 in include_from_node1(::String) at ./loading.jl:488
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318
while loading /home/phuoc/.julia/v0.5/Knet/examples/mnist.jl, in expression starting on line 161

from knet.jl.

ilkerkesen avatar ilkerkesen commented on August 17, 2024

Can you try to install AutoGrad with Pkg.clone and Pkg.build before installing Knet?

from knet.jl.

denizyuret avatar denizyuret commented on August 17, 2024

from knet.jl.

ngphuoc avatar ngphuoc commented on August 17, 2024

Thank you. Looking forwards to the next release :)

from knet.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.