Repository: pytorch
Issue: [Caffe2] MNIST Tutorial LMDB Error "Cannot open db" 
Labels: caffe2

## Issue description

I am trying to learn Caffe2, and am trying to run through the tutorials. For the MNIST tutorial (located here: https://github.com/caffe2/tutorials/blob/master/MNIST.ipynb), I am seeing an error when executing the line `workspace.RunNetOnce(train_model.param_init_net)`. I get:

```
RuntimeError: [enforce fail at db.h:190] db_. Cannot open db: /Users/205314/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb of type lmdb Error from operator: 
output: "dbreader_/Users/205314/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" name: "" type: "CreateDB" arg { name: "db" s: "/Users/205314/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" } arg { name: "db_type" s: "lmdb" }
```

This is for an unmodified MNIST.ipynb notebook. I have confirmed there are data.mdb and lock.mdb files in the following path: `/Users/205314/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb`. In the past, I have also tried all four combinations of using the MLP vs LeNet models and loading data by brew.db_input vs model.TensorProtosDBInput - none of these combos work. 

I've seen other posts on this issue such as:

- https://github.com/caffe2/caffe2/issues/1074
- https://github.com/caffe2/caffe2/issues/2282
- https://github.com/pytorch/pytorch/issues/9736
- https://github.com/pytorch/pytorch/issues/7807
- https://github.com/caffe2/tutorials/issues/7

But most of these issues were either older, posted by those who built from source or had different environment variables otherwise, or were posted in the caffe2 repo before the source was merged into pytorch. Most also did not have resolutions.

I really want to use Caffe2 for an upcoming research project I'm doing, but am having quite a hard time getting these tutorials to run so that I can have confidence I'll be able to learn the platform and create and train my own models. I've read fantastic things about Caffe2/Pytorch, but I'm beginning to worry if it's a little young or the documentation isn't robust enough for a new guy like me (the learning process is going to be a large part of my endeavor, so tutorials like this are **very** helpful when they work). If anyone can help get me back on track and moving forward with Caffe2 that would be stellar! Thanks.

## Code example

You can download and run the code in a Jupyter Notebook exactly as I'm running it: https://github.com/caffe2/tutorials/blob/master/MNIST.ipynb

## System Info
Please copy and paste the output from our
[environment collection script]

N/A. I've only installed Caffe2 via conda. So the output of this script is just:

```
Traceback (most recent call last):
  File "collect_env.py", line 11, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'
```

- PyTorch or Caffe2: Caffe2
- How you installed PyTorch (conda, pip, source): Conda pre-built binaries according to these instructions: https://caffe2.ai/docs/getting-started.html?platform=mac&configuration=prebuilt
- Build command you used (if compiling from source): N/A
- OS: Mac OS 10.13.6
- PyTorch version: N/A
- Python version: 3.5.6
- CUDA/cuDNN version: N/A (have not elected to use GPU yet)
- GPU models and configuration: N/A
- GCC version (if compiling from source): N/A
- CMake version: ? (N/A but I've seen others with this issue describe fixing it this way, but those folks built from source)
- Versions of any other relevant libraries: lmdb version 0.94 (installed into Conda environment via pip since the Anaconda package is out of date), conda version 4.5.8, Caffe2 pre-built binary version "0.8.dev" and build "py36_2018.07.20" (from Anaconda)