Anaconda

PyTorch出现:RuntimeError: An attempt has been made to start a new process...报错 (已解决)

心不动则不痛 提交于 2020-10-25 05:50:31
PyTorch出现:RuntimeError: An attempt has been made to start a new process...报错 (已解决) 最近从新调试一段pytorch 代码,以前的服务器上完全没问题,但换了一台机器,重新安装了新版本的 cuda,anaconda,pytorch 等,以前的代码出现各种版本不适合的问题。一天下来,解决了 n 个问题。 问题: 现在说说这个问题。运行 pytorch 时出现的情况如下: RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the

Anaconda环境下GPT2-Chinese的基本使用记录

人走茶凉 提交于 2020-10-24 20:00:10
偶然在看到了这个项目,感觉很厉害,于是就折腾了下,跑了一跑 项目地址: https://github.com/Morizeyao/GPT2-Chinese 如果Github下载太慢的可以用这个代下载: https://toolwa.com/github/ 环境准备 1.pytorch 的安装 由情况选择版本安装,安装CPU版本梢简单 # 安装时官方源下载比较慢,要换源 conda install pytorch torchvision cpuonly -c pytorch # 如果cnda装不了 选择pip的方式进行安装 # pip也要指定源 pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html Anacoda 换源 onda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ # 设置搜索时显示通道地址 conda config --set show

linux history历史记录命令详解

与世无争的帅哥 提交于 2020-10-24 06:02:49
一、什么是history 在bash功能中,它能记忆使用过的命令,这个功能最大的好处就是可以查询曾经做过的举动! 从而可以知道你的运行步骤,那么就可以追踪你曾下达过的命令,以作为除错的工具! 二、History的保存 那么命令记录在哪里呢?在家目录内的 .bash_history 里! 不过,需要留意的是,~/.bash_history 记录的是前一次登陆以前所运行过的命令,而至于这一次登陆所运行的命令都被缓存在内存中,当你成功的注销系统后,该命令记忆才会记录到 .bash_history 当中! 查看当前用户所有历史记录命令 history 查看当前用户最近n条历史记录命令 history n 清除linux历史记录命令 history -c 清除所有的历史命令 可能还需要清除下~/.absh_history文件 history -d 5 清除命令号为5的记录 history -a 将目前新增的 history 命令新增入 histfiles 中,若没有加 histfiles , 则默认写入 ~/.bash_history -r 将 histfiles 的内容读到目前这个 shell 的 history 记忆中; -w 将目前的 history 记忆内容写入 histfiles 中! 快速查找需要的历史命令 !!:重复执行上一个命令 !+数字,!101