python
Kair94
这个作者很懒,什么都没留下…
展开
-
PySOT测试报错:AssertionError: /pysot/experiments/siamrpn_r50_l234_dwxcorr/Basketball/img/0001.jpg
1. Problem按照PySOT项目官方给出的测试指令执行:cd experiments/siamrpn_r50_l234_dwxcorrpython -u ../../tools/test.py \ --snapshot model.pth \ # model path --dataset VOT2018 \ # dataset name --config config.yaml # config file会因为路径问题而报错,例如:AssertionError: /hom原创 2021-11-08 01:08:49 · 1126 阅读 · 6 评论 -
PySOT测试过程中OTB100.josn找不到OTB2015数据集的Jogging-1、Jogging-2、Skating2-1、Skating2-2、Human4-2
1. ProblemPySOT测试过程中,使用PySOT项目给出的OTB100.josn找不到OTB2015数据集的Jogging-1、Jogging-2、Skating2-1、Skating2-2、Human4-2目录。2. SolutionOTB2015(OTB100)数据集相应的.josn是不同的,需要根据.josn文件,对OTB2015数据集中的部分文件夹进行修改:复制Jogging文件夹,并分别重命名为:Jogging-1和Jogging-2复制Skating2文件夹,并分别重命名为:原创 2021-11-08 00:56:33 · 1141 阅读 · 0 评论 -
屏蔽警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Solutionimport osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'Reference警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA转载 2021-11-07 22:51:49 · 67 阅读 · 0 评论 -
余弦相似度与两个特征在经过L2归一化之后的矩阵内积等价
ReferenceL2范数归一化概念和优势余弦距离比对对的几种写法 cos距离pytorch计算两个特征的余弦相似度原创 2021-11-03 15:22:21 · 1481 阅读 · 0 评论 -
Pytorch实现ResNet+FPN
ReferenceSOURCE CODE FOR TORCHVISION.MODELS.RESNET(ResNet源码,Pytorch官方实现 )SOURCE CODE FOR TORCHVISION.OPS.FEATURE_PYRAMID_NETWORK(FPN源码,Pytorch官方实现)torchvision.ops.FeaturePyramidNetwork()FPN+ResNet的Pytorch实现ResNet理论基础与具体实现(详细教程)FPN(特征图金字塔网络)理论基础与具.原创 2021-10-26 18:02:14 · 1330 阅读 · 0 评论 -
将torch.Tensor格式的图片转换为numpy.ndarray格式
下述两个函数均可:1.def image_Tensor2ndarray(image_tensor: torch.Tensor): """ 将tensor转化为cv2格式 """ assert (len(image_tensor.shape) == 4 and image_tensor.shape[0] == 1) # 复制一份 image_tensor = image_tensor.clone().detach() # 到cpu image原创 2021-10-23 23:03:02 · 1912 阅读 · 0 评论 -
pytorch中的l2_normalize函数
pytorch_l2_normalize.pyimport torchimport tensorflow as tf########## PyTorch Version 1 ################x = torch.randn(5, 6)norm_th = x/torch.norm(x, p=2, dim=1, keepdim=True)norm_th[torch.isnan(norm_th)] = 0 # to avoid nan########## PyTorch Versi原创 2021-10-22 22:26:47 · 4840 阅读 · 0 评论 -
NotImplementedError: Cannot convert a symbolic Tensor to a numpy array报错与解决
problemtensorflow --version = 2.3.0NotImplementedError: Cannot convert a symbolic Tensor (sequential/simple_rnn/strided_slice:0) to a numpy array. This error may indicate that you’re trying to pass a Tensor to a NumPy call, which is not supportedsolut转载 2021-08-17 17:36:06 · 2421 阅读 · 2 评论 -
Python创建、删除文件夹(os、shutil)
import osimport shutil判断文件夹是否存在os.path.exists('path/folder')创建文件夹path存在的情况下,在path下创建新文件夹new_folder,否则抛出error。os.mkdir('path/new_folder')递归创建文件夹path不存在的情况下,在该path下递归创建新文件夹new_folder。os.makedirs('path/new_folder')删除空文件夹folder必须是空文件,否则抛出原创 2021-08-06 16:00:22 · 873 阅读 · 0 评论 -
python模块详解 | progressbar
python模块详解 | progressbar转载 2021-03-17 22:21:40 · 922 阅读 · 0 评论 -
解决问题:module ‘tensorflow._api.v2.image‘ has no attribute ‘resize_bilinear‘
tensorflow --version: 2.2.0keras --version: 2.3.1error:module 'tensorflow._api.v2.image' has no attribute 'resize_bilinear'解决方案:将:tf.image.resize_bilinear(x[1], size=(tf.shape(x[0])[1], tf.shape(x[0])[2]), align_corners=True)改为:tf.compat.v1.image原创 2021-03-17 22:09:38 · 5196 阅读 · 4 评论 -
Tensorflow和Keras版本对应关系
https://docs.floydhub.com/guides/environments/原创 2021-03-17 17:38:55 · 1569 阅读 · 0 评论 -
解决问题:cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-jhawztrk/opencv/modules/highgui/src/window.cpp:651:
OS: ubuntu16.04IDE: pychramerror:cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-jhawztrk/opencv/modules/highgui/src/window.cpp:651: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa supp原创 2021-03-17 17:36:19 · 13533 阅读 · 3 评论 -
解决问题:module ‘tensorflow‘ has no attribute ‘reset_default_graph‘
import tensorflow as tf错误:module 'tensorflow' has no attribute 'reset_default_graph'解决方案:将tf.reset_default_graph()改为tf.compat.v1.reset_default_graph()原创 2021-03-15 15:43:05 · 11136 阅读 · 0 评论