
原创
j-o-l-i-n
半路出家机房扫地僧,沉迷火炉炼丹和修仙。精通徒手写bug,曾出版《如何一秒爆显存》。
展开
-
pytorch DistributedDataParallel提示未参与loss计算的变量错误
错误提示:RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by (1) passing原创 2021-01-29 22:20:21 · 12846 阅读 · 2 评论 -
提交spark任务偶尔报错 org.apache.spark.SparkException: A master URL must be set in your configuration
错误信息可谓恶心至极,其中有几个关键词,在代码里压根没有,但是我的debug能力也专门针对恶心的 错误信息优化过,所以最终还是解决了。错误信息:20/11/24 22:32:00 INFO DAGScheduler: ResultStage 0 (take at Base64UserEmb.scala:57) failed in 16.761 s due to Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times,原创 2020-11-24 23:08:15 · 544 阅读 · 0 评论 -
NVIDIA/Apex安装时遇到 C++编译:unrecognized command line option ‘-std=c++14’ 错误解决
0、问题编译安装apex的时候,报错C++编译:unrecognized command line option ‘-std=c++14’,后面紧跟着ninja也没有编译成功。发现是编译器版本太老(gcc-4.8.5)外加没有设置CC环境变量。对于C++14:gcc5就可以完全支持,gcc4部分支持,gcc3及以下版本不支持。既然4.8.5不支持c++14,就重新编译了g++呗。1、解决的环境版本依赖原本的环境配置:操作系统环境是:tlinux2.2-64bit-4...原创 2020-10-31 18:22:23 · 2387 阅读 · 6 评论 -
AttributeError: 'DistributedDataParallel' object has no attribute 'blahblah'
Pytorch DDP would fail when using the parameters directly to calculate the loss.These are my scripts:# train.py:class Model(nn.Module): def __init__(self, params): ... self.xnli_proj = nn.Linear(dim, 3)...model = Model(params)output = model.x原创 2020-05-12 00:06:19 · 4129 阅读 · 1 评论 -
detectron2 demo cuda10.0 py3.6
conda create -n detectron python=3.6 pipconda activate detectronconda install pytorch torchvision cudatoolkit=10.0 ...原创 2020-03-14 19:24:45 · 852 阅读 · 0 评论 -
caffe compilation memo
Compile caffe from sourceNCCL (nvidia.com has been blocked ???? download local installer then apt update to install)# https://docs.nvidia.com/deeplearning/sdk/nccl-install-guide/index.html# download ...原创 2019-10-24 11:35:27 · 159 阅读 · 0 评论 -
如何用python一个字一个字的输出汉字
for z in zi.decode('utf-8'): print(z.encode('utf-8'))原创 2016-05-12 19:17:48 · 13641 阅读 · 2 评论 -
用nohup重定向python输出到文件不成功的解决办法
原因是:It looks like you need to flush stdout periodically (e.g. sys.stdout.flush()). In my testing Python doesn't automatically do this even with print until the program exits.You can run Python wit原创 2016-05-15 21:25:38 · 3601 阅读 · 0 评论 -
给公司的电脑配置theano
anaconda安装的pythonpip install theano安装theano输入import theano遇到warning提示没有找到g++conda install mingw输入import theano遇到报错屏幕爆炸,其中提示Problem occurred during compilation with the command line below:D:\原创 2016-07-05 11:44:22 · 506 阅读 · 0 评论 -
在实验室服务器毫无阻拦的安装pip3
curl "https://bootstrap.pypa.io/3.2/get-pip.py" -o "get-pip.py"sudo python3 get-pip.py原创 2016-07-27 17:38:01 · 900 阅读 · 0 评论 -
pycharm远程调试报错cant ser remote tunneling
一开始就报错cant ser remote tunneling就把远程的etc/ssh/sshd_config里面的AllowTcpForwarding改成yes然后service sshd restart 还是不行!!!后来找到python console上面有好多好多错误,最后一行显示的是traitlets.traitlets.TraitError: No default va原创 2016-07-06 17:29:02 · 1288 阅读 · 0 评论 -
成功在家用ssh远程连上了学校电脑虚拟机当中的ubuntu(代价是虚拟机全部黑屏只能用SSH连接了!)
首先打开虚拟机,安装openssh server,开启ssh服务用ifconfig查询虚拟机ip 比如192.168.159.133如图所示,虚拟网络编辑器-> VMnet8-> NAT设置-> 端口转发-> add -> IP:192.168.159.133,PORT:22原创 2016-05-01 22:30:34 · 1768 阅读 · 0 评论 -
迄今为止我所见过的将BP算法最好的PPT
http://www.cedar.buffalo.edu/~srihari/CSE574/Chap5/Chap5.3-BackProp.pdf原创 2015-09-03 00:56:40 · 2370 阅读 · 0 评论 -
CSS做一个小黄人
原发明人的文章:http://mp.weixin.qq.com/s?__biz=MjM5OTA1MDUyMA==&mid=210492428&idx=2&sn=c3581ceac502efe70396c42adc8cf3f0&scene=1&srcid=KXmyGTvQ7tPviFLp52fo&key=dffc561732c226518cdc1384523b0b9a18f770a8ddd8f695原创 2015-08-31 23:55:42 · 913 阅读 · 0 评论 -
编译lua过程
下载Cmake,去github下载lua-masterCmake的Where is the source code选择lua-master文件夹E:/Source/Web/lua-masterwhere to build the binaries 随便设置一个E:/Source/Web/lua-build点configure,generator选择vs12 2013 win64(选原创 2015-08-28 23:36:09 · 513 阅读 · 0 评论 -
VS2013 调用的目标发生了异常
我使用vs2013打开mongodb-csharp的驱动(不是官方的,是第三方放在github上的),总是报错:调用的目标发生异常,于是乎找到这个解决办法:添加用户变量windir=C:\Windows,重启。(环境变量里变量" windir 的值虽然从外面看是C:\Windows, 但当你点击windir进行修改的时候, 值是%SystemRoot%)原创 2015-07-21 11:16:31 · 5065 阅读 · 0 评论 -
Visual studio 2013 err:visual studio no editoroptiondefinition export found for the given option ...
删除或重命名(关闭VS):C:\Users\jolin\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache原创 2015-07-15 16:24:45 · 1314 阅读 · 0 评论 -
MongoDB 我的学习笔记
一.参考物:1.官方网站安装指南:http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/?_ga=1.180686695.1988910824.14369284942.官方网站对.NET驱动的使用指南:http://docs.mongodb.org/ecosystem/drivers/csharp/原创 2015-07-15 14:28:34 · 584 阅读 · 0 评论 -
我的GitHub Blog开通了
http://jolinxql.github.io参考原创 2014-09-28 17:21:17 · 497 阅读 · 0 评论 -
非root用户暴力法解决选择性使用两个cudnn
之前学弟安装了一个cuda, 放在默认的地方/usr/local/cuda-7.5/后来加入cuDNN的lib64和include也拷贝到了这里,但是他是su,我不是。但这个cuDNN版本是5103,我的theano需要5,不需要5.1,不然总是有warning。又折腾了一天。下面是我的方法:从/usr/local/cuda-7.5/拷贝所有除了lib64和include的文件夹到原创 2016-09-21 13:38:06 · 2305 阅读 · 0 评论 -
mac上解决中文乱码, arara实现LaTex多命令执行, LaTeXiT法文界面转英文
强迫症犯了花了一天解决了mac上的latex中文及周边问题。首先,处理mac上的中文乱码问题:将win上的转成无BOM的utf8+macintoch格式然后开头结尾和中间共三处加入条件编译语句。复制到mac上以后设置texshop默认打开编码为utf-8(cmd+Q关闭重开),用XeLaTex编译。搞定。(参考:http://liam0205.me/2014/11/02/latex-macte原创 2016-10-06 16:57:30 · 4760 阅读 · 1 评论 -
flask+apache2+ubuntu
假设安装好了apache2 virtualenv。mkdir venvvirtualenv venvsource venv/bin/activatepip install flask/var/www/flask-prod/webtool.py:from flask import Flaskapp = Flask(__name__)@app.route("/")def hello():原创 2016-11-28 18:53:10 · 2844 阅读 · 0 评论 -
python built-in cache (don't reinvent the wheel)
@functools.lru_cachedef func(): ...very useful for loading/rolling out huge image features.原创 2019-02-16 16:39:56 · 312 阅读 · 0 评论 -
Why I can't reproduce my results
1. Pytorch's CPU's and GPU's seeds are independent. So set/save/load them independentlyhttps://discuss.pytorch.org/t/are-gpu-and-cpu-random-seeds-independent/1422. If you use randomness on several...原创 2019-02-16 13:51:49 · 227 阅读 · 0 评论 -
配置jupyter notebook到conda env虚拟环境里可运行
python -m ipykernel install --user --name env_name原创 2018-06-19 23:04:44 · 1751 阅读 · 0 评论 -
connect to ubuntu 16.04 from windows 10 using x11vnc
以前ubuntu上不但装过vnc,还配置成功过一次,但是登陆之后桌面会变成gnome一个奇奇怪怪的样子。所以这次重新搞。主要是通过x11vnc,使得远程访问能够完美还原unity桌面。最近升级18.04,全gnome了,于是follow: http://c-nergy.be/blog/?p=11187 搞定了。1. terminal:sudo apt-get install x11v...原创 2018-06-07 17:44:13 · 487 阅读 · 0 评论 -
Install Rouge and Pyrouge for python 2.7 (conda virtual env) on Linux 64
Install Rouge and PyrougeStep 1: Create a new conda virtual envconda create -n py27env python=2.7 pipsource activate py27env# use " source deactivate" to deactivate the env原创 2017-08-23 17:32:48 · 2599 阅读 · 0 评论 -
神经网络中快速傅立叶变换(FFT)的梯度传递
最近需要在神经网络中构造复数酉矩阵做权重系数,使用了快速傅立叶变换和反变换.但是FFT不是theano的现成操作模块(有人写过对应的代码,所以应该会很快加进去了),所以想自己去写梯度传递来彻底搞清楚这件事.重新学一遍离散Fourier transform再加找梯度相关的文献学习,整整花了一周时间.从本科一毕业DFT就忘光了...在此总结了下,不得不说推倒的结果出来以后,真是出乎意料的漂原创 2017-09-05 21:24:42 · 6422 阅读 · 3 评论 -
解决Pycharm里远程调试缺乏DISPLAY环境变量的TkAgg报错
错误: TclError: no display name and no $DISPLAY environment variable Backend TkAgg is interactive backend. Turning interactive mode on.解决: 随便一个靠前的代码里加入import matplotlibmatplotlib.use('Agg')原创 2017-08-21 00:46:40 · 9608 阅读 · 2 评论 -
windows上配置新的conda env+torch
conda create -n myenv scipy nb_conda -c peterjc123 torchpip install torchvision原创 2017-07-05 15:25:45 · 851 阅读 · 0 评论 -
ubuntu 备份
https://yq.aliyun.com/ziliao/110763备份前及恢复前,需要用root用户,所以要打开root密码(http://www.cnblogs.com/youxin/archive/2013/04/07/3006201.html),备份及恢复之后,需要把root登录密码关闭(https://askubuntu.com/questions/20450/disable-原创 2017-06-29 22:09:53 · 373 阅读 · 0 评论 -
ubuntu+intellij IDEA+android环境配置
前半截完全按照这个:http://askubuntu.com/questions/318246/complete-installation-guide-for-android-sdk-adt-bundle-on-ubuntu之后注意遇到无法clean是因为程序都在挂载的盘上,所以用这个解决:http://stackoverflow.com/questions/32914499/error-ex原创 2016-11-28 14:40:47 · 875 阅读 · 0 评论 -
ubuntu上装texlive
先把基本的texlive装好之前提前就把微软字体复制到/usr/share/fonts下了。sudo apt-get install perl-tk(为了用tlmgr)记得如果用texlive 2015的tlmgr装包的话,一定要改repo:tlmgr option repository ftp://tug.org/historic/systems/texlive/原创 2016-11-12 21:46:32 · 1368 阅读 · 0 评论 -
CRF++中的unigram和bigram features指定是uni/bigrams的输出标签
Cite: (http://www.cnblogs.com/pangxiaodong/archive/2011/11/21/2256264.html) unigram/bigram很容易混淆,因为通过unigram-features也可以写出类似%x[-1,0]%x[0,0]这样的单词级别的bigram(二元特征)。而这里的unigram和bigram features指定是un原创 2015-05-15 15:53:05 · 2647 阅读 · 1 评论 -
for bat utf
chcp 65001for %%i in (*.json) do (echo %%~ni.json >> ..\j.txtTYPE %%i >> ..\j.txtecho %%~ni.debug >> ..\d.txtTYPE %%~ni.debug >> ..\d.txt)chcp 65001是为了防止非utf的dos经过>>写入文件产生乱码,原创 2015-05-04 13:20:06 · 313 阅读 · 0 评论 -
在NPP运行Python报错:SyntaxError: Non-ASCII character '\xe5' in file的解决方法
SyntaxError: Non-ASCII character '\xe5' in file原创 2014-09-30 11:10:33 · 874 阅读 · 0 评论 -
解决开ServiceHost时候System.PlatformNotSupportedException: Operation is not supported on this platform.
方法一:以管理员身份运行VS。开启。方法二:添加配置文件方法原创 2014-10-23 14:53:15 · 11482 阅读 · 0 评论 -
NLP之路-warm up
今天做了一些小的尝试,算作技术铺垫原创 2014-09-28 17:14:17 · 1152 阅读 · 0 评论 -
NLP之路-python爬虫
解决了IDE中文显示的问题,通过print(soup.head.title).encode('gb18030')解决了中文路径无法打开的问题,通过file=open(u"D:/users/nancy/share/sae6depart/6系资料/python/crawl.txt","w")import urllibfrom urllib import urlopenc=urrllib.u原创 2014-09-27 15:37:23 · 1256 阅读 · 0 评论 -
Startup Script for Python(x,y)
碰巧在C:\Users\你的用户名\.ipython\profile_pysh\startup\文件夹下找到了README,里面写得很清楚,只要在此文件夹下放若干个.py文件,则会在ipython启动前执行这些文件(按照字母表顺序执行,如果有多个.py文件的话)。所以你就可以在这里各种import XXX as XX了。原创 2014-09-28 11:14:30 · 870 阅读 · 0 评论