timgremore
We are attempting to fine-tune a sentence transformer model and we’re getting an error when we run the Axon training loop. Our attempt can be found in this notebook: https://gist.github.com/timgremore/68693fd0aa22f60efd490ea191cdbf54.
The error is:
(ArgumentError) cannot convert %{cache: #Axon.None<...>, hidden_state: #Nx.Tensor<
f32[5][64][384]
...
to tensor because it represents a collection of tensors, use Nx.stack/2 or Nx.concatenate/2 instead
(nx 0.6.4) lib/nx.ex:2168: Nx.to_tensor/1
(nx 0.6.4) lib/nx.ex:5470: Nx.apply_vectorized/2
(axon 0.6.0) lib/axon/losses.ex:895: Axon.Losses."__defn:cosine_similarity__"/3
(axon 0.6.0) lib/axon/loop.ex:376: anonymous fn/8 in Axon.Loop.train_step/4
(nx 0.6.4) lib/nx/defn/grad.ex:23: Nx.Defn.Grad.transform/3
(axon 0.6.0) lib/axon/loop.ex:402: anonymous fn/6 in Axon.Loop.train_step/4
(axon 0.6.0) lib/axon/loop.ex:1925: anonymous fn/6 in Axon.Loop.build_batch_fn/2
(nx 0.6.4) lib/nx/defn/compiler.ex:158: Nx.Defn.Compiler.runtime_fun/3
(exla 0.6.4) lib/exla/defn.ex:387: anonymous fn/4 in EXLA.Defn.compile/8
(exla 0.6.4) lib/exla/defn/locked_cache.ex:36: EXLA.Defn.LockedCache.run/2
(stdlib 5.1.1) timer.erl:270: :timer.tc/2
(exla 0.6.4) lib/exla/defn.ex:385: EXLA.Defn.compile/8
(exla 0.6.4) lib/exla/defn.ex:270: EXLA.Defn.__compile__/4
(exla 0.6.4) lib/exla/defn.ex:256: EXLA.Defn.__jit__/5
(nx 0.6.4) lib/nx/defn.ex:443: Nx.Defn.do_jit_apply/3
(stdlib 5.1.1) timer.erl:270: :timer.tc/2
(axon 0.6.0) lib/axon/loop.ex:1805: anonymous fn/4 in Axon.Loop.run_epoch/5
(elixir 1.15.7) lib/enum.ex:4830: Enumerable.List.reduce/3
(elixir 1.15.7) lib/enum.ex:2564: Enum.reduce_while/3
(stdlib 5.1.1) timer.erl:295: :timer.tc/3
(axon 0.6.0) lib/axon/loop.ex:1685: anonymous fn/6 in Axon.Loop.run/4
(elixir 1.15.7) lib/range.ex:526: Enumerable.Range.reduce/5
(elixir 1.15.7) lib/enum.ex:2564: Enum.reduce_while/3
(axon 0.6.0) lib/axon/loop.ex:1669: Axon.Loop.run/4
We’ve been using this HF guide as inspiration: Train and Fine-Tune Sentence Transformers Models along with Bumblebee’s fine-tuning guide: Fine-tuning — Bumblebee v0.7.0
If anyone has some suggestions as to what we are missing, please let me know.
Thank you!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Most Liked- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
AndyL
HTH - a working script that uses the same Bumblebee model as your code. You might need to remove the GPU config to run on a CPU…