logging the blob that has type error

Summary: Currently, it's not easy to track down which tensor is missing type and shape info. Print it out for easier debuggin.

Reviewed By: volkhin, xianjiec

Differential Revision: D5695223

fbshipit-source-id: 7f0be0be777a35bb5a71b3799b29b91f0763c159
This commit is contained in:
Kittipat Virochsiri
2017-08-23 21:16:38 -07:00
committed by Facebook Github Bot
parent 409d985d43
commit d368b59177

View File

@ -1079,6 +1079,7 @@ def InitEmptyRecord(net, schema_or_record, enforce_types=False):
shape = [0] + list(blob_type.shape)
net.ConstantFill([], blob, shape=shape, dtype=data_type)
except TypeError:
logger.warning("Blob {} has type error".format(blob))
# If data_type_for_dtype doesn't know how to resolve given numpy
# type to core.DataType, that function can throw type error (for
# example that would happen for cases of unknown types such as