![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
软件应用
solo_xiaowangzi
这个作者很懒,什么都没留下…
展开
-
resolve package not found, conda-forge::setuptools=59.5.0
有些人说去掉版本,如只有conda-forge::setuptools,但是试了之后会有其他问题。一个参考链接“Conda env create fails using environment.yml file. · Issue #9480 · ContinuumIO/anaconda-issues · GitHub”解决方法:Guess for me the problem was that the base env conda on remote had packages installed原创 2022-02-24 12:04:16 · 677 阅读 · 0 评论 -
RuntimeError: CUDA error: device-side assert triggered:index out of bounds“` failed.
最近被一个bug困扰了一两天。报错如下:line 109, in _Similarity dist_rho[dist_rho < 0] = 0RuntimeError: CUDA error: device-side assert triggeredCUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect...原创 2021-08-16 20:27:21 · 2279 阅读 · 0 评论 -
python 类 单下划线,双下划线,子类重写父类方法
1.类中前置双下划线__表示私有的,内部不允许访问,意思是只有类对象自己能访问,连子类对象也不能访问。双下划线开头的实例变量是不是一定不能从外部访问呢?其实也不是。不能直接访问__name是因为Python解释器对外把__name变量改成了_类名__name,所以,仍然可以通过_类名__name来访问__name变量。2.类中前置单下划线_开始的成员变量叫做保护变量,意思是只有类对象和子类对象自己能访问到这些变量;前置下划线的变量和方法代表这个变量和方法最好是只在类内部使用。意思就是,“虽然..原创 2020-09-12 11:40:19 · 1281 阅读 · 0 评论 -
类的继承,classmethod方法,函数不定长传参的一个综合简单实例
1.类的继承,讲解可以参考这篇博客https://www.cnblogs.com/bigberg/p/7182741.html2.@classmethod@classmethod装饰。 它的作用就是有点像静态类,比静态类不一样的就是它可以传进来一个当前类作为第一个参数。下面给出一段代码,详细注释了类和方法的使用,注意类的继承顺序:class Test0(object): def __init__(self, examples, filter_pred = None): ...原创 2020-09-10 16:10:30 · 367 阅读 · 0 评论 -
Can‘t find model ‘en‘ConnectionError: HTTPSConnectionPool(host=‘raw.githubusercontent.com‘, port=443
pip install spacy 和 pip install torchtext 后python语句 en = spacy.load('en') 运行报错如下:OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.解决命令如下:python -m spacy download en类.原创 2020-09-07 13:43:24 · 1399 阅读 · 1 评论 -
pycharm更改解释器不生效的解决方法
网上关于pycharm如何设置project interpreter有很多教程,再此不再一一罗列,有一篇关于pycharm三种解释器的区别可以参考理解一下https://blog.csdn.net/cxk207017/article/details/90047559。本人再project interpreter配置了四种interpreter如下图:其中1 2 4都是针对...原创 2019-08-11 14:02:16 · 9593 阅读 · 7 评论 -
b[a==1,0]
程序如下:b是5行5列3个channel的数组,可以理解为原图像,a是5行5列的数组,可以理解为mask,print(a==1)的结果:b[a==1,0]=1的意思是在b的channel0,a==1为True的位置上赋值为1,同理在b[a==1,1]=2的意思是在b的channel1,a==1为True的位置上赋值为2,b的结果如图:...原创 2019-08-31 17:03:17 · 164 阅读 · 0 评论