Machine Learning in Elixir: Error in Chapter 9, identifying cats and dogs again
the code provided I am running into an error when training the first model that uses transfer learning with ONNX model mobilenetv2-7. I am a bit stuck here, not really sure what may be wrong.
warning: Axon.Optimizers.adam/1 is deprecated. Use Polaris.Optimizers.adam/1 instead
machine-learning-in-elixir-src/StopReinventingTheWheel.livemd#cell:s4yqqx5n4j6oyja2b2c57iqes4fvcbny:2
12:22:35.339 [warning] found unexpected key in the initial parameters map: "mobilenetv20_output_pred_fwd"
Epoch: 0, Batch: 700, accuracy: 0.7747430 loss: 0.4431267
Batch: 6, accuracy: 0.9151786 loss: 0.1636844
** (ArgumentError) argument at position 1 is not compatible with compiled function template.
{
<<<<< Expected <<<<<
#Nx.Tensor<
f32[32][channels: 3][height: 160][width: 160]
>
==========
#Nx.Tensor<
f32[26][channels: 3][height: 160][width: 160]
>
>>>>> Argument >>>>>
,
<<<<< Expected <<<<<
#Nx.Tensor<
s64[32][1]
>
==========
#Nx.Tensor<
s64[26][1]
>
>>>>> Argument >>>>>
}
(nx 0.6.2) lib/nx/defn.ex:323: anonymous fn/7 in Nx.Defn.compile_flatten/5
(elixir 1.15.2) lib/enum.ex:1819: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
(nx 0.6.2) lib/nx/lazy_container.ex:61: Nx.LazyContainer.Tuple.traverse/3
(nx 0.6.2) lib/nx/defn.ex:320: Nx.Defn.compile_flatten/5
(nx 0.6.2) lib/nx/defn.ex:312: anonymous fn/4 in Nx.Defn.compile/3
(stdlib 5.0.2) timer.erl:270: :timer.tc/2
(axon 0.6.0) lib/axon/loop.ex:1805: anonymous fn/4 in Axon.Loop.run_epoch/5
/data/machine-learning-in-elixir-src/StopReinventingTheWheel.livemd#cell:s4yqqx5n4j6oyja2b2c57iqes4fvcbny:10: (file)
Popular Pragprog topics

Dockerfile:
FROM ruby:2.6
RUN apt-get update -yqq
RUN apt-get install -yqq --no-install-recommends nodejs
COPY . /usr/src/app/
WORKDI...
New

In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New

When I try the command to create a pair of migration files I get an error.
user=> (create-migration "guestbook")
Execution ...
New

Title: Web Development with Clojure, Third Edition, vB17.0 (p9)
The create table guestbook syntax suggested doesn’t seem to be accepted ...
New

I ran this command after installing the sample application:
$ cards add do something --owner Brian
And got a file not found error:
Fil...
New

@noelrappin
Running the webpack dev server, I receive the following warning:
ERROR in tsconfig.json
TS18003: No inputs were found in c...
New

Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New

When trying to run tox in parallel as explained on page 151, I got the following error:
tox: error: argument -p/–parallel: expected one...
New

Hi,
I am getting an error I cannot figure out on my test.
I have what I think is the exact code from the book, other than I changed “us...
New

Hi, I’m working on the Chapter 8 of the book.
After I add add the point_offset, I’m still able to see acne:
In the image above, I re...
New
Other popular topics

If it’s a mechanical keyboard, which switches do you have?
Would you recommend it? Why?
What will your next keyboard be?
Pics always w...
New

I’ve been really enjoying obsidian.md:
It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New

“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin
Even when you’re ultimately right about what the future ho...
New

Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New

This is going to be a long an frequently posted thread.
While talking to a friend of mine who has taken data structure and algorithm cou...
New

We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New

The File System Access API with Origin Private File System.
WebKit supports new API that makes it possible for web apps to create, open,...
New

Author Spotlight: Jamis Buck (@jamis)
This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for P...
New

A Ruby-Centric Chat with Noel Rappin @noelrappin
Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New

This is cool!
DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON
We just witnessed something incredible: the largest open-s...
New
Latest in Pragprog
Latest (all)
Categories:
My Saved Portals
-
None saved yet
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /security
- /django
- /nodejs
- /centos
- /haskell
- /rails
- /fable
- /gleam
- /swift
- /js
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /preact
- /flutter
- /c-plus-plus
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /vuejs
- /nim
- /emacs
- /nerves
- /elm