
Python
Ubuntu_ximi
这个作者很懒,什么都没留下…
展开
-
TensorRT的调试报错整理
TensorRT的调试报错整理报错:pycuda._driver.LogicError: explicit_context_dependent failed: invalid device context - no currently active context?原因:pycuda.driver没有初始化,导致无法得到context,需要在导入pycuda.driver后再导入pycuda....原创 2019-10-30 15:14:09 · 7872 阅读 · 0 评论 -
Python的包(package)和模块(modul)以及相对导入和绝对导入的那些小tricks
代码增加到一定阶段,一定避不开包package和模块module,而这又往往是初学者困惑所在,这里整理下自己踩的坑和一些经验教训。作者:Su Liang,2018-10-24 (程序员节)参考《Python Cookbook》, David BeazleyQ: 如何设置文件的包(package)和模块(module),并进行模块导入?假定如下文件结构:mypackage/init...原创 2018-10-24 21:34:52 · 618 阅读 · 0 评论 -
python报错ValueError: The truth value of an array with more than one element is ambiguous. Use a.any()
python报了一个比较少见的错:ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()后来发现错误发生在如下语句:if tree.result != None: # 当到达叶子节点,则直接返回tree.result作为预测标签 r...原创 2019-07-07 16:53:43 · 11091 阅读 · 0 评论 -
pytorch中训练深度神经网络模型的关键知识点
关于数据格式默认日常描述图片尺寸,采用[w,h]的形式,比如一张图片是1280*800就是指宽w=1280, 高h=800。因此在cfg中所指定img scale = [1333, 800]就是指w=1333, h=800从而转入计算机后,要从w,h变成h,w默认的大部分数据集,输出格式都是n,h,w,c和bgr格式,一方面是hwc更普遍,另一方面是opencv读取的就是bgr。pyt...原创 2019-09-20 11:00:04 · 1983 阅读 · 0 评论