dicarlolab/archconvnets

Bug in extracting features?

Closed this issue · 2 comments

I'm having trouble retrieving features after extracting them. E.g.

import bson
from dldata.stimulus_sets import issa
data = issa.IssaPLStims()
model_id = bson.ObjectId('534c1ec6c626a8063eae8acd')
preproc = {'normalize': False, 'dtype': 'float32', 'mask': None, 'crop': None, 'mode': 'RGB', 'resize_to': [256, 256]}
feature_layers = ['pool5','fc6']
f = data.get_features(preproc, model_id, feature_layers)

The database query fails to find a record. This may appears to be because the record in the database is not saved with the preproc as an OrderedDict, but as a regular Dict. If I manually go in and edit the query, the record is in the database. I'm not sure where in the extraction code this is fowling up. @ardila any ideas?

Also, what is the convention for producing a model_id as a bson.ObjectId? I can't find any documentation on this.

Some more digging on this, and I found I needed to upgrade yamutils. It was a problem in the version of the yamutils.mongo.SONify method. So the input into the DB is fixed for me... but still could use an answer to this question:
what is the convention for producing a model_id as a bson.ObjectId? I can't find any documentation on this.

Yes I have been dealing with some of these issues as well. I think I'm
going to change it so you don't have to do it is the id field in the
database where the checkpoints are stored.
you can do
from bson import ObjectId

and then do dataset.get_extractions() to see the id of the model you've
extracted. You can also query the checkpoint database to find model ids.

On Wed, May 7, 2014 at 10:34 AM, Charles Cadieu notifications@github.comwrote:

Some more digging on this, and I found I needed to upgrade yamutils. It
was a problem in the version of the yamutils.mongo.SONify method. So the
input into the DB is fixed for me... but still could use an answer to this
question:
what is the convention for producing a model_id as a bson.ObjectId? I
can't find any documentation on this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-42434551
.