CAFFE2的MNIST的验证运行问题, 为何显示打不开LMDB数据库
无论是从CAFFE2的安装目录 caffe2\caffe2\python\tutorials\ 中的找到的 MNIST.ipynb 还是从 官网 https://caffe2.ai/docs/tutorial-MNIST.html#main_wrap 下载的 代码, 均都是可以成功下载到lmdb文件
lmdb train db found! lmdb test db found!
training data folder:/home/xinwei/caffe2_notebooks/tutorial_data/mnist workspace root folder:/home/xinwei/caffe2_notebooks/tutorial_files/tutorial_mnist
但是在juoyter notebook 中执行到workspace.RunNetOnce后,显示打不开数据库???
RuntimeError Traceback (most recent call last) <ipython-input-13-c329ccc61e68> in <module>() 1 # The parameter initialization network only needs to be run once. ----> 2 workspace.RunNetOnce(train_model.param_init_net) 3 # creating the network 4 workspace.CreateNet(train_model.net, overwrite=True) 5 # set the number of iterations and track the accuracy & loss /usr/local/caffe2/python/workspace.py in RunNetOnce(net) 208 C.Workspace.current._last_failed_op_net_position, 209 GetNetName(net), --> 210 StringifyProto(net), 211 ) 212 /usr/local/caffe2/python/workspace.py in CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs) 191 def CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs): 192 try: --> 193 return func(*args, **kwargs) 194 except Exception: 195 op_id = op_id_fetcher()
RuntimeError: [enforce fail at db.h:206] db_. Cannot open db: /home/xinwei/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb of type lmdb Error from operator: output: "dbreader_/home/xinwei/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" name: "" type: "CreateDB" arg { name: "db_type" s: "lmdb" } arg { name: "db" s: "/home/xinwei/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" }Now we can sample some of the data and predictions.
lmdb train db found! lmdb test db found!
training data folder:/home/xinwei/caffe2_notebooks/tutorial_data/mnist workspace root folder:/home/xinwei/caffe2_notebooks/tutorial_files/tutorial_mnist
但是在juoyter notebook 中执行到workspace.RunNetOnce后,显示打不开数据库???
RuntimeError Traceback (most recent call last) <ipython-input-13-c329ccc61e68> in <module>() 1 # The parameter initialization network only needs to be run once. ----> 2 workspace.RunNetOnce(train_model.param_init_net) 3 # creating the network 4 workspace.CreateNet(train_model.net, overwrite=True) 5 # set the number of iterations and track the accuracy & loss /usr/local/caffe2/python/workspace.py in RunNetOnce(net) 208 C.Workspace.current._last_failed_op_net_position, 209 GetNetName(net), --> 210 StringifyProto(net), 211 ) 212 /usr/local/caffe2/python/workspace.py in CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs) 191 def CallWithExceptionIntercept(func, op_id_fetcher, net_name, *args, **kwargs): 192 try: --> 193 return func(*args, **kwargs) 194 except Exception: 195 op_id = op_id_fetcher()
RuntimeError: [enforce fail at db.h:206] db_. Cannot open db: /home/xinwei/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb of type lmdb Error from operator: output: "dbreader_/home/xinwei/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" name: "" type: "CreateDB" arg { name: "db_type" s: "lmdb" } arg { name: "db" s: "/home/xinwei/caffe2_notebooks/tutorial_data/mnist/mnist-train-nchw-lmdb" }Now we can sample some of the data and predictions.
5 个回复
tensorflow2017
赞同来自:
# The parameter initialization network only needs to be run once.
workspace.RunNetOnce(train_model.param_init_net)
# creating the network
workspace.CreateNet(train_model.net, overwrite=True)
# set the number of iterations and track the accuracy & loss
total_iters = 200
accuracy = np.zeros(total_iters)
loss = np.zeros(total_iters)
# Now, we will manually run the network for 200 iterations.
for i in range(total_iters):
workspace.RunNet(train_model.net)
accuracy[i] = workspace.FetchBlob('accuracy')
loss[i] = workspace.FetchBlob('loss')
# After the execution is done, let's plot the values.
pyplot.plot(loss, 'b')
pyplot.plot(accuracy, 'r')
pyplot.legend(('Loss', 'Accuracy'), loc='upper right')
lbd5788
赞同来自:
wywwork
赞同来自:
陶潜水
赞同来自:
zwb666
赞同来自: