Closed jinserk closed 4 years ago
It's embarrassing but I forgot to make all numpy arrays as batch-like (expand_dims
). It worked if I changed:
data_saver({
"id": np.asarray([key]),
"fp": np.expand_dims(feat, axis=0),
"target": np.expand_dims(target, axis=0),
})
But one thing I'd like to suggest is, it will be the best if we have any option to save all data element-wise: so if the attribute has the dims of (20, 20), then will be better to put not (B, 20, 20) but (20, 20) array with some additional option like elementwise=True
in DataSaver.__call__()
or separated function DataSaver.save_element()
.
@jinserk
Thanks for the detailed bug reporting. The first issue with filetype
is my mistake.
The filetype is the content added to 0.2.0, and it is an option to save the corresponding file when you enter the file path here.
This is a boolean option called filetype. Therefore, I set an error to occur when the filetype is False
and the attribute type is string, and I will remove it.
fixed
It's embarrassing but I forgot to make all numpy arrays as batch-like (
expand_dims
). It worked if I changed:data_saver({ "id": np.asarray([key]), "fp": np.expand_dims(feat, axis=0), "target": np.expand_dims(target, axis=0), })
But one thing I'd like to suggest is, it will be the best if we have any option to save all data element-wise: so if the attribute has the dims of (20, 20), then will be better to put not (B, 20, 20) but (20, 20) array with some additional option like
elementwise=True
inDataSaver.__call__()
or separated functionDataSaver.save_element()
.
The unittest related to this works without problems. Could you remove the raise TypeError("I suspect you need to set the filetype.")
and try again?
@jinserk I think all bugs in this issue has been resolved, so I'll close it. If you need more, please re-open. Thanks for your reporting!
Hi @graykode!
One question to save dataset including any
str
type vector. I have a dataset having string type identifiers. These identifiers aren't used in the training or the prediction calculation but used in analyze of the prediction, especially for the outliers. Of course I can make any converting integer vector to map the integer id to the string identifier, but I found theDataAttribute
supportsstring
type, so tried to use it. Here the code I wrote is:but I got an error as:
I have no idea what the
filetype
means here, so I'd like to ask your help. Could you let me know how to usestring
type vector as a part of my dataset? Thank you in advance!