mkpaszkiewicz / vse

Configurable visual search engine
MIT License
9 stars 2 forks source link

How to save vse and load it later? #1

Open PulkitMishra opened 5 years ago

PulkitMishra commented 5 years ago

@mkpaszkiewicz I am currently extracting features from a pretrained model and saving it to vse. Wanted to know if there is a way to save that vse and load it later?

mkpaszkiewicz commented 5 years ago

Hi @PulkitMishra, have you tried:

engine = vse.create_vse(vocabulary_path='/some/path')
vse.save(filename='/some/other/path', data=engine)

then you can load it with: engine = vse.load(filename='/some/other/path')

Alternatively you can use pickle package directly.

PulkitMishra commented 5 years ago

@mkpaszkiewicz thanks for I tried pickle. But on loading it shows that it is dependent on a python module. Is there a way out?

mkpaszkiewicz commented 5 years ago

Can you show me your code and error message?

PulkitMishra commented 5 years ago

@mkpaszkiewicz https://github.com/IvonaTau/style-search/blob/master/Interior%20style%20dataset%20benchmark.ipynb

I'm trying to run this. Added a pickle.dump() after vse = finder.initiate_engine(RESULTS_DIRECTORY, FEATURE_EXTRACTION_MODEL). It gets saved but on loading it using pickle.load I get No module named 'cnn_feature_extraction'

Is there a way to save the extracted features so that I dont have to run the feature extraction code again?