philipbrown / handwritten-digits Goto Github PK
View Code? Open in Web Editor NEWHandwritten digit recognition in Elixir
Handwritten digit recognition in Elixir
axon bumped their exla/nx dependencies to 0.2.0
without bumping it's own version.
So when trying to run mix deps.get
I get a version conflict. I was able to just comment out the exla and nx deps from mix.exs
and it worked ok. But I was also following the blog post here: https://fly.io/phoenix-files/recognize-digits-using-ml-in-elixir/
With the following dependencies:
{:phoenix, "~> 1.6.5"}, {:phoenix_html, "~> 3.0"}, {:phoenix_live_reload, "~> 1.2", only: :dev}, {:phoenix_live_view, "~> 0.17.5"}, {:floki, ">= 0.30.0", only: :test}, {:phoenix_live_dashboard, "~> 0.6"}, {:esbuild, "~> 0.3", runtime: Mix.env() == :dev}, {:swoosh, "~> 1.3"}, {:telemetry_metrics, "~> 0.6"}, {:telemetry_poller, "~> 1.0"}, {:gettext, "~> 0.18"}, {:jason, "~> 1.2"}, {:plug_cowboy, "~> 2.5"}, {:tailwind, "~> 0.1", runtime: Mix.env() == :dev}, {:axon, "~> 0.3.0"}, {:scidata, "~> 0.1.5"}, {:evision, "~> 0.1.0-dev", github: "cocoa-xu/evision", branch: "main"}
and after clicking "Predict" on the frontend, I get the following error:
[error] GenServer #PID<0.2059.0> terminating ** (MatchError) no match of right hand side value: %Evision.Mat{channels: 1, dims: 2, type: {:u, 8}, raw_type: 0, shape: {384, 384}, ref: #Reference<0.2647608870.945422355.36505>} (digits 0.1.0) lib/digits/model.ex:65: Digits.Model.predict/1 (digits 0.1.0) lib/digits_web/live/page_live.ex:54: DigitsWeb.PageLive.handle_event/3 (phoenix_live_view 0.17.9) lib/phoenix_live_view/channel.ex:382: anonymous fn/3 in Phoenix.LiveView.Channel.view_handle_event/3 (telemetry 1.1.0) /Users/user/xxx/xxx/handwritten-digits/deps/telemetry/src/telemetry.erl:320: :telemetry.span/3 (phoenix_live_view 0.17.9) lib/phoenix_live_view/channel.ex:215: Phoenix.LiveView.Channel.handle_info/2 (stdlib 4.1.1) gen_server.erl:1123: :gen_server.try_dispatch/4 (stdlib 4.1.1) gen_server.erl:1200: :gen_server.handle_msg/6 (stdlib 4.1.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3 Last message: %Phoenix.Socket.Message{topic: "lv:phx-FzRxEyuOZneo9-tE", event: "event", payload: %{"event" => "image", "type" => "hook", "value" => "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAd40lEQVR4Xu3dCZBsVXkH8IfRKBoDrkgEF5SISwyKYimW4i5LFIi4BNEiuCakXMEFFBQ3FqPlUhFLDSpRoyJuqMGooBXKJdEQE3cUxQU1KliKJCaS/9UHAeG9/u7M7e57+/y6asrHm++e853fOd7/m+mZ7i02eBAgQIBAkwJbNLlqiyZAgACBDQLAISBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNt2wCBAgIAGeAAAECjQoIgEY33rIJECAgAJwBAgQINCogABrdeMsmQICAAHAGCBAg0KiAAGh04y2bAAECAsAZIECAQKMCAqDRjbdsAgQICABngAABAo0KCIBGN96yCRAgIACcAQIECDQqIAAa3XjLJkCAgABwBggQINCogABodOMtmwABAgLAGSBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNt2wCBAgIAGeAAAECjQoIgEY33rIJECAgAJwBAgQINCogABrdeMsmQICAAHAGCBAg0KiAAGh04y2bAAECAsAZIECAQKMCAqDRjbdsAgQICABngAABAo0KCIBGN96yCRAgIACcAQIECDQqIAAa3XjLJkCAgABwBggQINCogABodOMtmwABAgLAGSBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNt2wCBAgIAGeAAAECjQoIgEY33rIJECAgAJwBAgQINCogABrdeMsmQICAAHAGCBAg0KiAAGh04y2bAAECAsAZIECAQKMCAqDRjbdsAgQICABngAABAo0KCIBGN96yCRAgIACcAQIECDQqIAAa3XjLJkCAgABwBggQINCogABodOMtmwABAgLAGSBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNt2wCBAgIAGeAAAECjQoIgEY33rIJECAgAJwBAgQINCogABrdeMsmQICAAHAGCBAg0KiAAGh04y2bAAECAsAZIECAQKMCAqDRjbdsAgQICABngAABAo0KCIBGN96yCRAgIACcAQIECDQqIAAa3XjLJkCAgABwBggQINCogABodOMtmwABAgLAGSBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNt2wCBAgIAGeAAAECjQoIgEY33rIJECAgAJwBAgQINCogABrdeMsmQICAAHAGCBAg0KiAAGh04y2bAAECAsAZIECAQKMCAqDRjbdsAgQICABngAABAo0KCIBGN96yCRAgIACcAQIECDQqIAAa3XjLJkCAgABwBggQINCogABodOMtmwABAgLAGSBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNt2wCBAgIAGeAAAECjQoIgEY33rIJECAgAJwBAgQINCogABrdeMsmQICAAHAGCBAg0KiAAGh04y2bAAECAsAZIECAQKMCAqDRjbdsAgQICABngAABAo0KCIBGN96yCRAgIACcAQIECDQqIAAa3XjLJkCAgABwBggQINCogABodOMtmwABAgLAGSBAgECjAgKg0Y23bAIECAgAZ4AAAQKNCgiARjfesgkQICAAnAECBAg0KiAAGt14yyZAgIAAcAYIECDQqIAAaHTjLZsAAQICwBkgQIBAowICoNGNv2TZF1988R7586PysW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1F36o6GbueYVGfNJlTHVECAwbgEBMO796X5Ja+u02P3Ez/Y9Wv1yartv1fy8ek3mOTi1ryvUfzzjVr5SKAylhACBZQoIgGXqz5g7N+WrpqT7l/xuPdr8WWpvn5v0N3pc0wXNnVL/mcI1P8/Yv1eoU0KAwMgFBMCINyg35TenvUf2aLH7Xv+euUF/qMc1vy7NXFfL/1yUj6sUrt2hb8AUxlRCgMCCBQTAgsGr0+WG3L2Je/dm7n0ez82N+eg+F1y2NnN+If/dPd8w6/Gnmaf7cVQPAgQmLCAARrh5uRHvn7be3rO19+am/OCe11yuPPN2rytU+U3fozPXc9czl2sJEFi+gABY/h789k34LvmL7jV+frdHa92/3Hft86TvlY2dAHhm/v7FhXlPzVx7F+qUECAwYgEBMKLNyQ34D9POp/LR/eRP9XF+Cu84xPfkM/8DM9YHCxP/MPPdsFCnhACBEQsIgJFsTm6+3Q31k/m4ec+W7pmbcfcVw7of6WGbDHJecaDtMu93irXKCBAYoYAAGMGm5MZ77bTxiXz8cc92HpOb8Ot7XrPZ8vTynym4XmFM7w1QQFJCYMwCAmDJu7Pxxy9PTxuV9+W9bLfH5+bf/aTQoI/084EMuEdhUE8EF5CUEBizgABY4u7kZtv5vzcffZ9QfUdu/g+dR+vpqfsx0iMKY38gPexVqFNCgMBIBQTAEjcmN9vqO3FdtsuP5j/uX32Nn77LS0/75JpTCtd9Pz3cqFCnhACBkQoIgCVtTG60r83Uj+05/edSf/fceC/seV25PH11rzn0reIF26eX0vsIFMdTRoDAAgUEwAKxL5kqN9mX5899X1HznFzT/az/D+fdcvr7Qea4QW" <> ...}, ref: "7", join_ref: "4"} State: %{components: {%{}, %{}, 1}, join_ref: "4", serializer: Phoenix.Socket.V2.JSONSerializer, socket: #Phoenix.LiveView.Socket<id: "phx-FzRxEyuOZneo9-tE", endpoint: DigitsWeb.Endpoint, view: DigitsWeb.PageLive, parent_pid: nil, root_pid: #PID<0.2059.0>, router: DigitsWeb.Router, assigns: %{__changed__: %{}, flash: %{}, live_action: :index, prediction: nil}, transport_pid: #PID<0.2053.0>, ...>, topic: "lv:phx-FzRxEyuOZneo9-tE", upload_names: %{}, upload_pids: %{}}
Is this a known issue, or is just something wrong with my local version of the project? I did not change anything except updating the axon dependency because I got errors while compiling the dependencies.
Thanks for creating and publishing the project btw!
Thanks for any help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.