Error : Torch models in Pytorch

I converted the googlenet (inception_v1) model from Torch to Pytorch using and trying to run the imagenet validation ( but I am getting the following error:

Traceback (most recent call last):
File “”, line 287, in
File “”, line 122, in main
validate(val_loader, model, criterion)
File “”, line 211, in validate
output = model(input_var)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/modules/”, line 206, in call
result = self.forward(*input, **kwargs)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/”, line 61, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/”, line 71, in parallel_apply
return parallel_apply(replicas, inputs, kwargs)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/”, line 46, in parallel_apply
raise output
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/”, line 25, in _worker
output = module(*input, **kwargs)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/modules/”, line 206, in call
result = self.forward(*input, **kwargs)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/modules/”, line 64, in forward
input = module(input)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/nn/modules/”, line 206, in call
result = self.forward(input, **kwargs)
File “/media/me/E/pytorch_examples/example7_imagenet/”, line 19, in forward
return self.lambda_func(self.forward_prepare(input))
File “/media/me/E/pytorch_examples/example7_imagenet/”, line 34, in
Lambda(lambda x,lrn=torch.legacy.nn.SpatialCrossMapLRN(
(11, 0.00109999999404, 0.5, 2)): Variable(lrn.forward(,
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/legacy/nn/”, line 33, in forward
return self.updateOutput(input)
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/legacy/nn/”, line 25, in updateOutput
File “/home/me/anaconda3/lib/python3.6/site-packages/torch/_thnn/”, line 22, in getattr
raise NotImplementedError

Looks like Pytorch doesn’t have SpatialCrossMapLRN (Torch Architecture in Pytorch). Is there any work-around for this?
OR anybody has pretrained model for inception-v1 in Pytorch?


You may want to temporarily use . This is a simple modification of PyTorch’s SpatialCrossMapLRN in legacy.