Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tutorial Deep Learning with Torch has maybe issues #23

Open
mcenderdragon opened this issue May 27, 2017 · 0 comments
Open

The tutorial Deep Learning with Torch has maybe issues #23

mcenderdragon opened this issue May 27, 2017 · 0 comments

Comments

@mcenderdragon
Copy link

mcenderdragon commented May 27, 2017

while trying something from the tutorial I noticed when defining the training data the code is:


-- ignore setmetatable for now, it is a feature beyond the scope of this tutorial. It sets the index operator.
setmetatable(trainset, 
    {__index = function(t, i) 
             return {t.data[i], t.label[i]} 
                end}
);
trainset.data = trainset.data:double() -- convert the data from a ByteTensor to a DoubleTensor.

function trainset:size() 
    return self.data:size(1) 
end

but that crashes with an stackoverflow error if you try to acces size()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant