Skip to content

Pooling throws an exception in Tegra TX1 #1906

@dimatura

Description

@dimatura

Hi all, great work with pytorch. I'm trying to use pytorch in a Jetson TX1, but running into some issues. One of them is pretty simple: pooling doesn't seem to work.

First, some details:

  • Jetson TX1, a 64-bit ARM architecture with a tegra TX1
  • Ubuntu 16.04 aarch64
  • CUDA 8.0, CUDNN 5105
  • python 2.7
  • Built from source (conda not available yet) from at least two git commits - 7c24a, Jun 23 and one from roughly a week earlier. Currently compiling the 0.1.12 tag - will update when done. Tag 1.12 (ccdf54) actually works correctly, with and without cuda.

Here's a simple example:

import torch
import torch.nn as nn                                                                                                                                                                                              
from torch.autograd import Variable                                                                                                                                                                                
                                                                                                                                                                                                                    
net = nn.MaxPool2d(2)#.cuda()                                                                                                                                                                                      
#net = nn.AvgPool2d(2)#.cuda()                                                                                                                                                                                      
                                                                                                                                                                                                                    
xd = torch.FloatTensor(1, 3, 448, 448)                                                                                                                                                                           
x = Variable(xd, volatile=True)#.cuda()                                      `                                                                                                                                      
y = net.forward(x)                                                                                                                                                                                                 
print(y.data.mean())

when using MaxPool2d, I get

terminate called after throwing an instance of 'THArgException'
  what():  can't expand an empty tensor at /home/ubuntu/apps/pytorch/torch/lib/TH/generic/THTensor.c:295
Aborted

when using AvgPool2d, oddly I get a different error: AvgPool2d works as expected.

Since I'm not too experienced with the internals, I'm not sure what changes matter, but I changed a few things (using cuda or cpu, volatile or not, the tensor size, the pooling parameters) and always got the same result. As a very very approximate workaround I've been using extra striding in my convolutions, but obviously that's not ideal ;).

Metadata

Metadata

Assignees

No one assigned

    Labels

    high prioritymodule: crashProblem manifests as a hard crash, as opposed to a RuntimeErrormodule: nnRelated to torch.nnneeds reproductionEnsure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions