Repository: pytorch
Issue: [Caffe2] Can't load pretrained model
Labels: caffe2

If you have a question or would like help and support, please ask at our
[forums](https://discuss.pytorch.org/).

If you are submitting a feature request, please preface the title with [feature request].
If you are submitting a bug report, please fill in the following details.

## Issue description

I ran code from (this caffe2 tutorial - "Loading Pre-Trained Models")[https://caffe2.ai/docs/tutorial-loading-pre-trained-models.html] and code is failing with error
```
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-14-314dd918183e> in <module>()
      7 
      8 # Initialize the predictor from the input protobufs
----> 9 p = workspace.Predictor(init_net, predict_net)
     10 
     11 # Run the net and return prediction

/opt/caffe2/caffe2/python/workspace.py in Predictor(init_net, predict_net)
    169 
    170 def Predictor(init_net, predict_net):
--> 171     return C.Predictor(StringifyProto(init_net), StringifyProto(predict_net))
    172 
    173 

RuntimeError: [enforce fail at operator.cc:58] blob != nullptr. op Conv: Encountered a non-existing input blob: data 
```
As i searched the web, I saw that some people add this line before net initialization to prevent this issue from occuring
```
workspace.FeedBlob("data", img)
```

But unfortunatelly, another error pops out
```---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-14-314dd918183e> in <module>()
      7 
      8 # Initialize the predictor from the input protobufs
----> 9 p = workspace.Predictor(init_net, predict_net)
     10 
     11 # Run the net and return prediction

/opt/caffe2/caffe2/python/workspace.py in Predictor(init_net, predict_net)
    169 
    170 def Predictor(init_net, predict_net):
--> 171     return C.Predictor(StringifyProto(init_net), StringifyProto(predict_net))
    172 
    173 

RuntimeError: [enforce fail at operator.cc:58] blob != nullptr. op Conv: Encountered a non-existing input blob: conv1_w
```

It's most likely that Caffe2 initialization of `squeezenet` is corrupt. Any info how to fix this issue would be great.

I tried downloading `.pb` files both from amazon and github.

## Code example

Please try to provide a minimal example to repro the bug.
Error messages and stack traces are also helpful.

```workspace.FeedBlob("data", img)
with open(INIT_NET, "rb") as f:
    init_net = f.read()
with open(PREDICT_NET, "rb") as f:
    predict_net = f.read()
    
# Initialize the predictor from the input protobufs
p = workspace.Predictor(init_net, predict_net)
```

## System Info
Please copy and paste the output from our
[environment collection script](`)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

- PyTorch or Caffe2: 0.8.1
- How you installed PyTorch (conda, pip, source): Docker image of caffe2 from NVCR.io
- OS: Linux 0cf485e1c286 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
- Python version: Python 3.5.2
- CUDA/cuDNN version: V9.0.176
- GPU models and configuration: GeForce GTX 1070