Open yaeldekel opened 6 years ago
Once we have this transform implemented, please revert the change in https://github.com/dotnet/machinelearning/pull/2935
Can we increase the priority of this? It'll be useful in Azure Attach scenarios for Model Builder and ML NET CLI. Model's exported from Azure are ONNX and expect the format to have the shape [3,224,224].
Just to follow up, we were able to work around it with a custom mapping. We also ended up getting a new model that didn't require it.
Example Custom Mapping that reshapes from [3,224,224] to [3 224 224].
[CustomMappingFactoryAttribute(nameof(ReshapeMapping))]
public class ReshapeMapping : CustomMappingFactory<ReshapeInput, ReshapeOutput>
{
// This is the custom mapping. We now separate it into a method, so that we can use it both in training and in loading.
public static void Mapping(ReshapeInput input, ReshapeOutput output) {
output.Reshape = input.Reshape;
}
// This factory method will be called when loading the model to get the mapping operation.
public override Action<ReshapeInput, ReshapeOutput> GetMapping()
{
return Mapping;
}
}
public class ReshapeInput
{
[ColumnName("input.1")]
[VectorType(3, 224, 224)]
public VBuffer<float> Reshape;
}
public class ReshapeOutput
{
[ColumnName("input.1")]
[VectorType(3 * 224 * 224)]
public VBuffer<float> Reshape;
}
This issue is more than 6 years old, any update?
We need the following functionalities in order to score TensorFlow models:
2 is already implemented as an option in the PixelExtractorTransform, and 3 could also be implemented as an option in that transform, but it may be useful to have them as a separate transform, for cases where the input data doesn't necessarily come from the PixelExtractorTransform.