Closed ayakubovich closed 9 years ago
@ayakubovich Sorry it's taken me so long to reply to this, definitely my fault. Take a look at the __init__
method of BatCountry, specifically the base_path
, which is the path to your Caffe model directory, deploy_path
which is the .prototxt file, and model_path
which is your .caffemodel file. These variables come with initial values that enable GoogLeNet to be used out of the box, but can be overridden to handle other models.
I'm curious about this same way to change the model... I understand the python code but in pratice I don't know how to change it other than renaming my caffemodel's name to the default google one and the same for the prototxt file... although the base_path can be changed due to your "visualize_layers.py" code requesting it on the "--base-model" parameter... Isn't it possible to optionally request the user in CLI the parameter to some specific coffemodel and prototxt files, and if nothing gets written then assume it's the googleNet the user wants to work with... I'm going to research some way of doing this even with my python being very rusty nowadays :)
Asking for a user to manually specify a path via command line argument isn't very Python, so I wouldn't recommend doing that. Here is some example code to specify the paths to the base_path
, model_path
, and deploy_path
using the BatCountry
constructor:
bc = BatCountry(base_path="/path/to/directory/containing/prototxt_and_caffemodel', deploy_path='filename_of.prototxt', model_path='filename_of.caffemodel')
As long as you specify those parameters, everything should workj ust fine.
Going ahead and marking this issue as resolved.
I'm getting some errors when I try to change the model from the default GoogLenet. I'm probably just not understanding the API correctly.
This works:
But this doesn't:
Are there additional arguments that need to be set when changing the model? I couldn't figure this out from the doc. In
demo_bulk.py
it seems like the only argument we pass is the path to the model.