facebookarchive / caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework.
https://caffe2.ai
Apache License 2.0
8.42k stars 1.94k forks source link

how to create 2 or more workspace instance in python API? #2545

Closed beichen2012 closed 6 years ago

beichen2012 commented 6 years ago

hi, I want to run the mtcnn net model, which have 3 nets(pnet, rnet, onet). but the workspace owned the blobs ,so, how to create 2 or more workspace instance in python API?

我想使用caffe2预测mtcnn模型, 这个模型有三个网络,pnet, rnet和onet。因为网络中的参数是由workspace保管的(blobs),所以如果三个网络使用同一个workspace就会出现同名的blob参数被覆盖的情况,所以我想问一下,python中如何创建两个及以上的workspace。

beichen2012 commented 6 years ago

OK, I find it out:

workspace.SwitchWorkspace