ankane / torch.rb

Deep learning for Ruby, powered by LibTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsupported index type: Float when running MNIST example

mib32 opened this issue · comments

Trying to run a MNIST example in a notebook on Paperspace.
In the last training step - this error occures:

Torch::Error: Unsupported index type: Float
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/tensor.rb:252:in `block in tensor_indexes'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/tensor.rb:233:in `map'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/tensor.rb:233:in `tensor_indexes'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/tensor.rb:191:in `[]'
/usr/local/lib/ruby/gems/2.7.0/gems/torchvision-0.1.3/lib/torchvision/datasets/mnist.rb:25:in `[]'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/utils/data/data_loader.rb:41:in `block (2 levels) in each'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/utils/data/data_loader.rb:41:in `map'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/utils/data/data_loader.rb:41:in `block in each'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/utils/data/data_loader.rb:39:in `each'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/utils/data/data_loader.rb:39:in `each_slice'
/usr/local/lib/ruby/gems/2.7.0/gems/torch-rb-0.3.4/lib/torch/utils/data/data_loader.rb:39:in `each'
<main>:2:in `each_with_index'
<main>:2:in `train'
<main>:5:in `block in <main>'
<main>:4:in `upto'
<main>:4:in `<main>'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/backend.rb:44:in `eval'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/backend.rb:44:in `eval'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/backend.rb:12:in `eval'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:90:in `execute_request'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:49:in `dispatch'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/kernel.rb:38:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/command.rb:110:in `run_kernel'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/lib/iruby/command.rb:40:in `run'
/usr/local/lib/ruby/gems/2.7.0/gems/iruby-0.4.0/bin/iruby:5:in `<top (required)>'
/usr/local/bin/iruby:23:in `load'
/usr/local/bin/iruby:23:in `<main>'

Hey @mib32, thanks for reporting! Looks like this was a result of the indexing changes in the 0.3.3 release. Will push a new release shortly (Docker takes about 20 minute to rebuild the image).

Thanks!

np, the new image is on Docker Hub: https://hub.docker.com/repository/docker/ankane/ml-stack/general

You'll probably need to delete and recreate the notebook on Paperspace.