# \#knet

**URL:** https://discourse.julialang.org/tag/knet/55.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Flux vs Knet for research and production](https://discourse.julialang.org/t/flux-vs-knet-for-research-and-production/78449)

<div class="topic-metadata">

**Author:** [@matic\_lauko](https://discourse.julialang.org/u/matic_lauko)\
**Replies:** 8\
**Last updated:** [March 27, 2022, 4:01pm UTC](https://discourse.julialang.org/t/flux-vs-knet-for-research-and-production/78449 "2022-03-27T16:01:26Z")

</div>

I’m new to AI in julia, and to AI in general, but still want to make the best decision or at least know the reason for choice. What are the advantages and disadvantages of both packages for production and also research. …

---

## [Knet prediction with CNN](https://discourse.julialang.org/t/knet-prediction-with-cnn/73527)

<div class="topic-metadata">

**Author:** [@KKesgin](https://discourse.julialang.org/u/KKesgin)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 9:43am UTC](https://discourse.julialang.org/t/knet-prediction-with-cnn/73527 "2021-12-30T09:43:16Z")

</div>

Hi, I’m new to neural nets with Julia and I’m guessing what I’ll ask is a very trivial question but I never struggled this much when I was getting started with the TensorFlow and I’m resisting really hard to not go back…

---

## ["Tensor LLVM Extensions ..." proposal + Julia example in the design document](https://discourse.julialang.org/t/tensor-llvm-extensions-proposal-julia-example-in-the-design-document/71456)

<div class="topic-metadata">

**Author:** [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Replies:** 0\
**Last updated:** [November 14, 2021, 12:41pm UTC](https://discourse.julialang.org/t/tensor-llvm-extensions-proposal-julia-example-in-the-design-document/71456 "2021-11-14T12:41:03Z")

</div>

“Tensor LLVM Extensions Proposed For Targeting AI Accelerators, Emerging Hardware” ( via/context: Tensor LLVM Extensions Proposed For Targeting AI Accelerators, Emerging Hardware - Phoronix 14 November 2021 ) And a …

---

## [Why is Python, not Julia, still used for most state-of-the-art AI research?](https://discourse.julialang.org/t/why-is-python-not-julia-still-used-for-most-state-of-the-art-ai-research/45896)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 65\
**Last updated:** [August 14, 2021, 8:12am UTC](https://discourse.julialang.org/t/why-is-python-not-julia-still-used-for-most-state-of-the-art-ai-research/45896 "2021-08-14T08:12:25Z")

</div>

I know e.g. ALBERTA, a variant of BERT, has been recreated in Julia, and AlphaZero, but all the (recent) papers I read, I see are still based on Python code, if the language is known to me (e.g. GPT-2 and updated GPT-3).…

---

## [Cannot locate artifact 'libknet8' in KNet](https://discourse.julialang.org/t/cannot-locate-artifact-libknet8-in-knet/61631)

<div class="topic-metadata">

**Author:** [@gforchini](https://discourse.julialang.org/u/gforchini)\
**Replies:** 0\
**Last updated:** [May 22, 2021, 10:10am UTC](https://discourse.julialang.org/t/cannot-locate-artifact-libknet8-in-knet/61631 "2021-05-22T10:10:09Z")

</div>

Hello, I have downloaded Knet from https://github.com/denizyuret/Knet.jl (but I have the same problem when I download Knet with Pkg.add(“Knet”)) to a Nvidia Jetson Nano (as it is an inexpensive method to finalise a Mon…

---

## [Knet on powerpc64le platform?](https://discourse.julialang.org/t/knet-on-powerpc64le-platform/48149)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 13\
**Last updated:** [October 24, 2020, 1:23pm UTC](https://discourse.julialang.org/t/knet-on-powerpc64le-platform/48149 "2020-10-24T13:23:28Z")

</div>

I am trying to use Knet on a supercomputer using powerpc64le nodes with NVidia TeslaV100 GPUs. But I am not able to compile it (so no use it, with or without GPU access). It seems the Knet version installed (1.4.2) wan…

---

## [Batch training for LSTMs in Flux or Knet](https://discourse.julialang.org/t/batch-training-for-lstms-in-flux-or-knet/47762)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 5\
**Last updated:** [October 18, 2020, 7:57pm UTC](https://discourse.julialang.org/t/batch-training-for-lstms-in-flux-or-knet/47762 "2020-10-18T19:57:40Z")

</div>

I’m new to Flux so apologies if this is a dumb question/ has already been answered (I cannot figure it out based on a search here and the model zoo) I am trying to train an LSTM on a sequence of choices where more than …

---

## [\[Optimization\] How would you speed the RNN Flux / Zygote code up?](https://discourse.julialang.org/t/optimization-how-would-you-speed-the-rnn-flux-zygote-code-up/43037)

<div class="topic-metadata">

**Author:** [@Sixzero](https://discourse.julialang.org/u/Sixzero)\
**Replies:** 2\
**Last updated:** [July 14, 2020, 4:44pm UTC](https://discourse.julialang.org/t/optimization-how-would-you-speed-the-rnn-flux-zygote-code-up/43037 "2020-07-14T16:44:54Z")

</div>

Hey all, I worked with tensorflow1.x/2.x/pytorch/jax for years and now I found Julia language where I find there is a lot more opportunity. I would like to ask everyone so we can learn from each other, how would you op…

---

## [BoundsError: attempt to access n-element UnitRange{Int32} at index \[n+1\]](https://discourse.julialang.org/t/boundserror-attempt-to-access-n-element-unitrange-int32-at-index-n-1/37508)

<div class="topic-metadata">

**Author:** [@jackjacker](https://discourse.julialang.org/u/jackjacker)\
**Replies:** 1\
**Last updated:** [April 18, 2020, 10:32am UTC](https://discourse.julialang.org/t/boundserror-attempt-to-access-n-element-unitrange-int32-at-index-n-1/37508 "2020-04-18T10:32:27Z")

</div>

Hello, I’m recently using Knet and working on a CNN. I have a dataset-input of 20000x1x1x200000 which I use for training As soon as i start training with progress!(sgd(dtrn,ncycle(n))), I get following the error: Bou…

---

## [Reading from a KNetArray within a GPU kernel function](https://discourse.julialang.org/t/reading-from-a-knetarray-within-a-gpu-kernel-function/35767)

<div class="topic-metadata">

**Author:** [@dfenn](https://discourse.julialang.org/u/dfenn)\
**Replies:** 0\
**Last updated:** [March 9, 2020, 7:46pm UTC](https://discourse.julialang.org/t/reading-from-a-knetarray-within-a-gpu-kernel-function/35767 "2020-03-09T19:46:40Z")

</div>

Is it possible to use KNetArrays from within a custom GPU kernel function? The following MWE fails: using Knet using GPUArrays knArray = KnetArray(rand(4,4)) function kernel(state, knArray) temp = knArray\[1\] …

---

## [For Knet.jl connoisseurs : problem with WTYPE error](https://discourse.julialang.org/t/for-knet-jl-connoisseurs-problem-with-wtype-error/34523)

<div class="topic-metadata">

**Author:** [@Johncowk](https://discourse.julialang.org/u/Johncowk)\
**Replies:** 0\
**Last updated:** [February 12, 2020, 3:46pm UTC](https://discourse.julialang.org/t/for-knet-jl-connoisseurs-problem-with-wtype-error/34523 "2020-02-12T15:46:19Z")

</div>

I am trying to build a RNN with self-attention mechanism using knet (maybe I should have sticked to python …) and after fixing all sorts of puzzling error I am faced with the following one : AssertionError: r.c == nothi…

---

## [Best way to pass auxiliary arrays to Knet loss function](https://discourse.julialang.org/t/best-way-to-pass-auxiliary-arrays-to-knet-loss-function/33227)

<div class="topic-metadata">

**Author:** [@dfenn](https://discourse.julialang.org/u/dfenn)\
**Replies:** 0\
**Last updated:** [January 11, 2020, 1:58am UTC](https://discourse.julialang.org/t/best-way-to-pass-auxiliary-arrays-to-knet-loss-function/33227 "2020-01-11T01:58:10Z")

</div>

Julia beginner here, so I apologize if this is an obvious question. I’m implementing a model using Knet, and I’m writing a loss function that includes a penalty term that relies on information that is provided from outsi…

---

## [GPU support in Knet: Cannot allocate before CuArrays has been initialized](https://discourse.julialang.org/t/gpu-support-in-knet-cannot-allocate-before-cuarrays-has-been-initialized/30859)

<div class="topic-metadata">

**Author:** [@Peter.Zentis](https://discourse.julialang.org/u/Peter.Zentis)\
**Replies:** 2\
**Last updated:** [November 8, 2019, 3:04pm UTC](https://discourse.julialang.org/t/gpu-support-in-knet-cannot-allocate-before-cuarrays-has-been-initialized/30859 "2019-11-08T15:04:21Z")

</div>

Hi all, I am trying to work through the Knet tutorial (https://github.com/denizyuret/Knet.jl/blob/master/tutorial/50.cnn.ipynb) which worked great, just until I needed/wanted to use gpu support i.e. use a KnetArray. I …

---

## [CuArray allocation issue: How often is it a problem?](https://discourse.julialang.org/t/cuarray-allocation-issue-how-often-is-it-a-problem/27508)

<div class="topic-metadata">

**Author:** [@haberdashPI](https://discourse.julialang.org/u/haberdashPI)\
**Replies:** 5\
**Last updated:** [September 30, 2019, 2:40pm UTC](https://discourse.julialang.org/t/cuarray-allocation-issue-how-often-is-it-a-problem/27508 "2019-09-30T14:40:28Z")

</div>

Hi there, I’m thinking about making use of Flux and CuArrays for a new project. However, I was a little troubled to learn about this issue. It’s hard to a get a sense from that thread how often this is coming up as a pr…

---

## [Shuffeld minibatches of a large datasets](https://discourse.julialang.org/t/shuffeld-minibatches-of-a-large-datasets/21774)

<div class="topic-metadata">

**Author:** [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Replies:** 3\
**Last updated:** [March 25, 2019, 2:39pm UTC](https://discourse.julialang.org/t/shuffeld-minibatches-of-a-large-datasets/21774 "2019-03-25T14:39:35Z")

</div>

I would like to train a neural network (Knet or Flux, maybe I test both) on a large date set (larger than the available memory) representing a serie of images. In python tensorflow, I would use the Dataset API (tf.data.…

---

## [Atom can't evaluate a line which the regular REPL can](https://discourse.julialang.org/t/atom-cant-evaluate-a-line-which-the-regular-repl-can/17549)

<div class="topic-metadata">

**Author:** [@ahmetumutdurmus](https://discourse.julialang.org/u/ahmetumutdurmus)\
**Replies:** 2\
**Last updated:** [December 25, 2018, 10:23am UTC](https://discourse.julialang.org/t/atom-cant-evaluate-a-line-which-the-regular-repl-can/17549 "2018-12-25T10:23:52Z")

</div>

Hello, I encountered this error when using a registered Julia package called “Knet” yet I wasn’t sure whether to post it as an issue for Knet or ask it here. I eventually decided to ask about it here as the error was on…

---

## [Knet vs MXNet for programmer new to ML](https://discourse.julialang.org/t/knet-vs-mxnet-for-programmer-new-to-ml/10073)

<div class="topic-metadata">

**Author:** [@tdh](https://discourse.julialang.org/u/tdh)\
**Replies:** 25\
**Last updated:** [October 6, 2018, 1:48pm UTC](https://discourse.julialang.org/t/knet-vs-mxnet-for-programmer-new-to-ml/10073 "2018-10-06T13:48:11Z")

</div>

I’m an old programmer, but new to deep learning. I’ve done a lot of reading and simple tutorials to get a handle on the basics. I was getting ready to start a deep dive on the MXNet and Gluon documentation and tutorials …

---

## [Support for Sparse Matrices on GPU (CUSPARSE)](https://discourse.julialang.org/t/support-for-sparse-matrices-on-gpu-cusparse/15294)

<div class="topic-metadata">

**Author:** [@mboratko](https://discourse.julialang.org/u/mboratko)\
**Replies:** 1\
**Last updated:** [September 22, 2018, 4:34pm UTC](https://discourse.julialang.org/t/support-for-sparse-matrices-on-gpu-cusparse/15294 "2018-09-22T16:34:17Z")

</div>

Do any of the ML libraries (Flux, KNet) support sparse matrices on the GPU?

---

## [Simple Knet.jl Question: save/load model?](https://discourse.julialang.org/t/simple-knet-jl-question-save-load-model/8202)

<div class="topic-metadata">

**Author:** [@Joshua\_Bowles](https://discourse.julialang.org/u/Joshua_Bowles)\
**Replies:** 2\
**Last updated:** [January 6, 2018, 7:35pm UTC](https://discourse.julialang.org/t/simple-knet-jl-question-save-load-model/8202 "2018-01-06T19:35:41Z")

</div>

I’m new to julia (as of last week; toyed a bit long time ago with v0.2). I’ve looked over previous Knet posts, searched docs, and Knet (stable) source but can’t find an example of saving/loading a model. I see what look…

---

## [Knet.jl CNN Tutorial Speed](https://discourse.julialang.org/t/knet-jl-cnn-tutorial-speed/7500)

<div class="topic-metadata">

**Author:** [@rickhg12hs](https://discourse.julialang.org/u/rickhg12hs)\
**Replies:** 3\
**Last updated:** [December 12, 2017, 1:59pm UTC](https://discourse.julialang.org/t/knet-jl-cnn-tutorial-speed/7500 "2017-12-12T13:59:43Z")

</div>

Knet’s tutorial.ipynb trains a CNN with MNIST data. I have no GPU, but my quad-core I7 has been pegged for a day stuck on cnnmodels = \[ copy(train!(wcnn, dtrn)) for epoch=1:100 \];. Is this exceptionally long training t…

---

## [Segmented\_sum in Knet](https://discourse.julialang.org/t/segmented-sum-in-knet/3396)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 0\
**Last updated:** [April 27, 2017, 5:55am UTC](https://discourse.julialang.org/t/segmented-sum-in-knet/3396 "2017-04-27T05:55:03Z")

</div>

Hello, I have started to play with Knet, but I am unable to reproduce my work related to multi-instance learning in it, since I need segmented\_sum operation from tensorflow. I have created a small example using Knet u…

---

## [Speed of Knet](https://discourse.julialang.org/t/speed-of-knet/1927)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 0\
**Last updated:** [February 5, 2017, 7:58pm UTC](https://discourse.julialang.org/t/speed-of-knet/1927 "2017-02-05T19:58:46Z")

</div>

Hello All, I would like to ask if anyone experienced with KNet can explain me, what I am doing wrong and why a simple code like this is incredibly slow push!(LOAD\_PATH,joinpath(homedir(),“Work/julia/Knet”)) using Pat…
