English 中文(简体)
rch和 ten之间的不同产出
原标题:Different outputs between torch and tensorflow conv2d according to stride parameter

我在Pytorch和Tensorflow上建立了简单的召集网络。

我将重量推向从Pytorch受过预训的层的Tensorflow层,根据stride,大不相同。 参数

If the stride is set to 1, the l2 norm between the outputs is approximately same (0.8435), but when the stride is set to 2 or higher, the l2 norm is significantly high (156.6889).

是否有任何人解释为什么在Pytorch和Tensorflow对stride的计算有所不同?

# implementation on Pytorch
nn.Conv2d(3, 32, kernel_size=3, padding=1, stride=1, bias=False)

# implementation on Tensorflow
tf.keras.layers.Conv2D(filters=32, kernel_size=(3, 3), strides=1, padding="same", use_bias=False)

-> this results almost same output.

# implementation on Pytorch
nn.Conv2d(3, 32, kernel_size=3, padding=1, stride=2, bias=False)

# implementation on Tensorflow
tf.keras.layers.Conv2D(filters=32, kernel_size=(3, 3), strides=2, padding="same", use_bias=False)

-> this results different output.
问题回答

众所周知,Py Torch和Tensorflow的粉碎 con混凝土结果之间存在一些差异。 简言之,这些结果可能略有不同:边界效应、权重初始化——精确性、衰减和组群聚集、数字准确性和计算相关问题。

例如,str2是指可能产生大量产出差异的3px过滤器移动。 以前讨论过的其他细节:here:





相关问题
Minimal diffusion model (DDIM) for MNIST

For the purpose of learning I created a minimal DDIM for the MNIST dataset. Everything besides the math of diffusions I consider "extras." Here is my list: U-Net (removed - replaced with ...

Pulling data from Object detection script

I am working on an AI project for school. Is it possible to pull data from a TF Object detection algorithm and then go do a google search/reverse image search whatever it is detecting then display ...

Tensorflow cannot detect CUDA enabled device

I have an RTX 4070 on my Dell XPS laptop that also comes with an Intel IRIS Xe Graphics card. I am using Windows 11. I have NVIDIA Graphics Driver Version 535.98 installed on my system and has support ...

Compiler error while compiling tensorflow_io in curve25519.c

I am trying to compile tensorflow_io onto my Ubuntu 22.04.2 target machine that does not offer GPU nor AVX instruction. I am finding that the compile errors out on curve25519.c. Is there a dependency ...

热门标签