Em sex., 22 de nov. de 2019 às 04:57, Guo, Yejun <[email protected]> escreveu: > > Signed-off-by: Guo, Yejun <[email protected]> > --- > tools/python/convert_from_tensorflow.py | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/python/convert_from_tensorflow.py > b/tools/python/convert_from_tensorflow.py > index 605158a..5e87e22 100644 > --- a/tools/python/convert_from_tensorflow.py > +++ b/tools/python/convert_from_tensorflow.py > @@ -193,7 +193,10 @@ class TFConverter: > filter_width = ktensor.tensor_shape.dim[1].size > in_channels = ktensor.tensor_shape.dim[2].size > out_channels = ktensor.tensor_shape.dim[3].size > - kernel = np.frombuffer(ktensor.tensor_content, dtype=np.float32) > + if filter_height * filter_width * in_channels * out_channels == 1: > + kernel = np.float32(ktensor.float_val[0]) > + else: > + kernel = np.frombuffer(ktensor.tensor_content, dtype=np.float32) > kernel = kernel.reshape(filter_height, filter_width, in_channels, > out_channels) > kernel = np.transpose(kernel, [3, 0, 1, 2]) > > -- > 2.7.4 LGTM, should push soon.
> > _______________________________________________ > ffmpeg-devel mailing list > [email protected] > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > [email protected] with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
