tracel-ai / burn

Burn is a new comprehensive dynamic Deep Learning Framework built using Rust with extreme flexibility, compute efficiency and portability as its primary goals.
https://burn.dev
Apache License 2.0
8.93k stars 442 forks source link

Candle backend crashes web app in image-classification-web #1034

Open antimora opened 11 months ago

antimora commented 11 months ago

Describe the bug Candle backend crashes web app in image-classification-web.

To Reproduce

  1. cd examples/image-classification-web
  2. run ./build-for-web.sh
  3. run ./run-server.sh
  4. open the browser with the served link
  5. change backed to Candle
  6. select image.
  7. open debug console and you'll notice error

Expected behavior The image is classified without a crash.

Screenshots

image
dcvz commented 11 months ago

The issue is Candle does not support excluding pad count in pooling

dcvz commented 11 months ago

The average pool config that is being used in the squeezenet is using .with_count_include_pad(false) which is not supported in Candle.

antimora commented 11 months ago

The average pool config that is being used in the squeezenet is using .with_count_include_pad(false) which is not supported in Candle.

We can fix this by:

  1. Modify Candle backend with Zero padding the input before average pool (this is what PyTorch did).
  2. File a ticket with Candle team to enhance the avr pool.
nathanielsimard commented 11 months ago

The average pool config that is being used in the squeezenet is using .with_count_include_pad(false) which is not supported in Candle.

We can fix this by:

  1. Modify Candle backend with Zero padding the input before average pool (this is what PyTorch did).
  2. File a ticket with Candle team to enhance the avr pool.

@louisfd do you think it's possible?