twitter-archive / torch-dataset

An extensible and high performance method of reading, sampling and processing data for Torch
Apache License 2.0
76 stars 24 forks source link

`opt.inputDims` is a required argument but is not enforced #14

Open vzhong opened 8 years ago

vzhong commented 8 years ago

In this line https://github.com/twitter/torch-dataset/blob/master/lua/Batch.lua#L19

applyInputDims is called with opt.inputDims which by default is not set. However applyInputDims expects this argument and crashes (eg. assert fails) if this is not set.

I think there should be either

  1. Documentation specifying what opt.inputDims is
  2. Some automatic way of setting a default opt.InputDims.

Otherwise the README example under Multiple Indices fail when sampledBatcher is called:

   local getBatch, numBatches = dataset.sampledBatcher({
      batchSize = 1,
      samplerKind = { 'part-linear', 'part-linear-permutation' },   -- sample the first linearily, the second with a permutation
      processor = processor,
   })
zakattacktwitter commented 8 years ago

Sorry about that. Can you try the examples, they should all run without problems.

I don’t think you can default the inputDims, but we can definitely throw a better error when it is not provided.

On Tue, Feb 9, 2016 at 3:27 PM, Victor Zhong notifications@github.com wrote:

In this line https://github.com/twitter/torch-dataset/blob/master/lua/Batch.lua#L19

applyInputDims is called with opt.inputDims which by default is not set. However applyInputDims expects this argument and crashes (eg. assert fails) if this is not set.

I think there should be either

  1. Documentation specifying what opt.inputDims is
  2. Some automatic way of setting a default opt.InputDims.

Otherwise the README example under Multiple Indices fail when sampledBatcher is called:

local getBatch, numBatches = dataset.sampledBatcher({ batchSize = 1, samplerKind = { 'part-linear', 'part-linear-permutation' }, -- sample the first linearily, the second with a permutation processor = processor, })

— Reply to this email directly or view it on GitHub https://github.com/twitter/torch-dataset/issues/14.