3

I installed Caffe2 from source for Ubuntu. I don't use Anaconda and my python is python2.

which python gives me

/usr/bin/python

I can import lmdb in python. I can run tutorials from this page

My problem in testing one of the examples is "Can't open lmdb file".

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-19-c9a97f268658> in <module>()
      1 # The parameter initialization network only needs to be run once.
      2 # Now all the parameter blobs are initialized in the workspace.
----> 3 workspace.RunNetOnce(train_model.param_init_net)
      4 
      5 # Creating an actual network as a C++ object in memory.

/home/pytorch/build/caffe2/python/workspace.py in RunNetOnce(net)
    199         C.Workspace.current._last_failed_op_net_position,
    200         GetNetName(net),
--> 201         StringifyProto(net),
    202     )
    203 

/home/pytorch/build/caffe2/python/workspace.py in CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs)
    178 def CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs):
    179     try:
--> 180         return func(*args, **kwargs)
    181     except Exception:
    182         op_id = op_id_fetcher()

RuntimeError: [enforce fail at db.h:190] db_. Cannot open db: /home/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb of type lmdbError from operator: 
output: "dbreader_/home/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" name: "" type: "CreateDB" arg { name: "db_type" s: "lmdb" } arg { name: "db" s: "/home/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" }

I have all files and have read access.

I compiled pytorch with USE_LMDB=ON.

I see the same issues but can't find how they solved the issues. My laptop system is small with Ubuntu 16.4, with Nvidia Cuda GeForce GT 750M, so quite old model.

Then I found in one page. They solved the issue with changing LMDB_MAP_SIZE in lbdb.cc. So I changed to 4G, but still have error.

constexpr size_t LMDB_MAP_SIZE = 4294967296;//4gb 1099511627776;  // 1 TB

The problem is at this line

workspace.RunNetOnce(train_model.param_init_net)

How to solve the issue?

batuman
  • 7,066
  • 26
  • 107
  • 229

0 Answers0