Open weizhiliang0520 opened 2 years ago
我的结果和你的一样,请问你解决了嘛,怎么解决,谢谢!
我的结果和你的一样,请问你解决了嘛,怎么解决,谢谢
我之前遇到的是在colab上调试的,后面没有用google colab,直接用服务器跑代码就可以了。听说是因为python版本的问题,有说换成python3.8就好了,我在服务器上跑的是python3.6.12,你试试。
我的结果和你的一样,请问你解决了嘛,怎么解决,谢谢!
你看看这个博客: https://blog.csdn.net/qq_41647438/article/details/108344141
好的, 非常感谢!!
Hi @justchenhao Is this problem still unresolved?
hello Is this problem still unresolved?
我首先运行代码中的python demo.py ,然后报标题的错误。 自己的也分段查看涉及的代码模块,打印从模型输出的图像张量:print(pred) = [1,64,256,256,],请问最后代码中的result结果的图像是256_256_3。我不知道这个demo.py中最后保存的64chanel,如何变成3的?谢谢
你好,我跟你遇到了同样的问题,请问您解决了吗,我也想知道64通道如何变成3通道输出
I changed the python version to 3.8.13 but it didn't make sense. The key is the pytorch version. I have tried this:
pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
and it worked. cuda 10.1 could also be used with
pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
you can refer to this website https://pytorch.org/get-started/previous-versions/
self.dist = F.pairwise_distance(self.feat_A, self.feat_B, keepdim=True) F.pairwise_distance: 在PyTorch1.7中返回值的shape是torch.Size([1,64,64,1]) 在PyTorch1.8中返回值的shape是torch.Size([1,1,64,64])
Is anyone able to fix this issue?
Just Dimension problem. As above comments mentioned, we just need to permute dims. torch 1.10.0 ---> x1,x2 shape[B,H,W,C] --->result shape [B,H,W,1] self.feat_A = self.feat_A.permute(0, 2, 3, 1) self.feat_B = self.feat_B.permute(0, 2, 3, 1) self.dist = F.pairwise_distance(self.feat_A, self.featB, keepdim=True) # 特征距离 self.dist = self.dist.permute(0, 2, 3, 1) torch 1.8.0 ---> x1,x2 shape[B,C,H,W] --->result shape [B,1,H,W]_ self.dist = F.pairwise_distance(self.feat_A, self.feat_B, keepdim=True) # 特征距离
Just Dimension problem. As above comments mentioned, we just need to permute dims. torch 1.10.0 ---> x1,x2 shape[B,H,W,C] --->result shape [B,H,W,1] self.feat_A = self.feat_A.permute(0, 2, 3, 1) self.feat_B = self.feat_B.permute(0, 2, 3, 1) self.dist = F.pairwise_distance(self.feat_A, self.featB, keepdim=True) # 特征距离 self.dist = self.dist.permute(0, 2, 3, 1) torch 1.8.0 ---> x1,x2 shape[B,C,H,W] --->result shape [B,1,H,W]_ self.dist = F.pairwise_distance(self.feat_A, self.feat_B, keepdim=True) # 特征距离
Thank you, installing torch 1.8 worked with me
I want to know who have an idea to solve this problem.I have the same problem but i don't know how to deal it.
Just Dimension problem. As above comments mentioned, we just need to permute dims. torch 1.10.0 ---> x1,x2 shape[B,H,W,C] --->result shape [B,H,W,1] self.feat_A = self.feat_A.permute(0, 2, 3, 1) self.feat_B = self.feat_B.permute(0, 2, 3, 1) self.dist = F.pairwise_distance(self.feat_A, self.featB, keepdim=True) # 特征距离 self.dist = self.dist.permute(0, 2, 3, 1) torch 1.8.0 ---> x1,x2 shape[B,C,H,W] --->result shape [B,1,H,W]_ self.dist = F.pairwise_distance(self.feat_A, self.feat_B, keepdim=True) # 特征距离 不好意思想再请教一下,还是没太懂怎么修改
我首先运行代码中的python demo.py ,然后报标题的错误。 自己的也分段查看涉及的代码模块,打印从模型输出的图像张量:print(pred) = [1,64,256,256,],请问最后代码中的result结果的图像是2562563。我不知道这个demo.py中最后保存的64chanel,如何变成3的?谢谢