自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

只想安静地敲个代码

她说我是像星星一样的人

  • 博客(62)
  • 收藏
  • 关注

原创 vscode报错AttributeError: module ‘torch‘ has no attribute ‘float8_e4m3fn,但mobaxterm中可以正常跑

如果只在terminal中激活了正确的环境,这个位置选的环境不一样,没法在正确的环境中跑代码(我也不清楚为什么,实验表明如此)把这个位置选成正确的环境,在terminal中才能正确地跑代码;应该是vscode的一个bug。

2025-01-30 19:53:08 1072

原创 windows系统改变vscode的插件位置

【代码】windows系统改变vscode的插件位置。

2025-01-24 17:23:39 244

原创 解决git clone时报错“authentication failed for huggingface repository”

”,即不再支持输入huggingface的账户+密码的方式登录;“you must use a user access token or an ssh key”,即必须使用access token或是ssh key的方式登录。根据报错,问题出在没有为token选择repository和fine-grained的设置。已经获取了模型的授权,但是git clone时,弹出弹窗。输入huggingface的用户名和密码后,报错如下。接着填入token name+token即可访问。

2024-12-18 17:06:48 885

原创 解决登录用户不一致导致的 api_key not configured (no-tty). call wandb.login(key=[your_api_key])

公司里,debug和train用的是不同的平台,但共用存储空间。其实本质是:在自己的username下能跑,在root下不能跑。

2024-07-27 17:23:55 274

原创 解决obsidian加粗中文字体显示不突出的问题

改成显示突出的类型Microsoft YaHei UI。:默认字体的加粗版本本来就不突出。

2024-07-01 18:23:45 1164

原创 自定义pycharm TODO类注释以及其高亮颜色

2023-10-08 17:54:44 557

原创 pycharm配置ssh解释器出现“Error running ‘xxx‘: SDK is not defined for Run C…”或“cannot find remote create cre

pycharm配置ssh解释器出现“Error running ‘xxx’: SDK is not defined for Run C…”或“cannot find remote create credentials for target config com.jetbrains.plugins.remotesdk.target.webDeployment.WebDeploymentTargetEnvironmentConfiguration。

2023-10-07 11:29:50 1543

原创 服务器linux无图形界面上pyrender.OffscreenRenderer出现pyglet.canvas.xlib.NoSuchDisplayException的小白级解决方式

服务器linux无图形界面上pyrender.OffscreenRenderer出现pyglet.canvas.xlib.NoSuchDisplayException的小白级解决方式用osmesa

2023-03-05 14:27:55 2446

原创 解决Errors may have originated from an input operation. Input Source operations connected to Conv2D

Errors may have originated from an input operation.

2023-03-05 14:10:22 1902

原创 解决:pycharm调试时不能在变量同行显示变量的值,以及出现show value不能同步显示值

解决:pycharm调试时不能在变量同行显示变量的值

2023-02-22 15:28:11 567

原创 服务器上可以跑,本地Pycharm中报错Ninja is required to load C++ extensions

ninja is required to load C++ extensions

2023-02-22 15:17:18 2803 3

原创 解决CondaUpgradeError网上的方法都不奏效(回退版本、upgrade/update都不行)的问题和CondaValueError

Executing transaction: failedERROR conda.core.link:_execute(502): An error occurred while installing package 'conda-forge::certifi-2022.9.24-pyhd8ed1ab_0'.CondaUpgradeError: This environment has previously been operated on by a conda version that's newe

2023-02-20 20:32:25 1470

原创 torch tensor transpose函数:每次可以转置2 dim(线代上的转置)

2022-09-16 16:13:16 559

原创 pycharm远程调试的pytorch程序,显示cuda.is_available()为True,但Found no NVIDIA driver,加LD_LIBRARY_PATH也无法解决的解决方法

问题:远程能跑,本地连远程调试跑不通,显示Found no NVIDIA driver,或是torch._C._cuda_init() RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected

2022-09-08 19:41:01 1578

原创 实验室集群的使用,远程跑代码(配Anaconda虚拟环境、PyCharm远程解释器等),一站式教学

集群架构PC -------- 跳板机(数据中心) ---- 内网 ---- 计算节点数据中心中的个人目录会挂载到计算节点的目录下在数据中心存放自己的环境和代码在计算节点跑实验win10命令行登录数据中心和计算节点ssh -p [端口号] [用户名]@数据中心/计算节点IP用MobaXterm登录数据中心和计算节点新建sessionssh跳板机(数据中心)填写这些即可连上ssh计算节点要ssh内网的计算节点必须通过跳板机就ok了配Anaconda虚拟环境配在数据中心,

2022-04-18 00:33:52 5727

原创 python deque超限会怎样

会pop出最早放入的元素,然后push(python中即append)进想要加入的新元素不信试试下面这段:a = deque(maxlen=2)a.append(0)a.append(1)a.append(2)a.append(3)结果

2022-04-12 00:08:56 1042

原创 超详细,绝对能解决Cannot run program “D:\...\venv\Scripts\python.exe“ (in directory ): CreateProcess error=2

问题表现原因移动了project的位置,python解释器(即图中的Python Interpreter)的位置也跟着移动了,原本的解释器路径失效了解决方法修改python解释器的位置为移动后的位置①File->Settings->Project->Python Interpreter->Show All②Edit(点击那只笔)->将Interpreter path改为新路径(不会找的话,可以找找项目路径下venv文件夹,在里面找到Scripts\python

2021-11-15 16:12:39 30803 6

原创 1098 Insertion or Heap Sort (25 分) +测试要点

题目描述1098 Insertion or Heap Sort (25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the locati

2021-09-08 16:01:25 302

原创 1107 Social Clusters (30 分) + 测试要点

题目描述1107 Social Clusters (30 分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of people who have some of their hobbies in common. Yo

2021-09-06 17:09:04 220

原创 1043 Is It a Binary Search Tree (25 分) + 测试注意点

题目描述:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node’s key.The right subtree of a node contains only nodes with keys greate

2021-09-06 17:05:58 386

原创 1066 Root of AVL Tree (25 分) + 测试要点

题目描述1066 Root of AVL Tree (25 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this

2021-09-03 01:06:49 313

原创 1053 Path of Equal Weight (30 分) + 容易忽略的测试测试点

题目描述:1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R to any leaf node L

2021-08-31 21:29:17 455 3

原创 codeup - B: 数制转换 - 给出个人错误原因和测试数据

AC代码错误原因:char num[400];和char res[500];最初大小分别是40和50,不够大#include<stdio.h>#include<string.h>int main(){ int a,b; char num[400]; while(scanf("%d%s%d",&a,num,&b)!=EOF) { char res[500]; long c=0; int len=strlen(num); //print

2021-03-08 21:18:58 138

原创 codeup - A: 又一版 A+B - 不用数组存储而是直接输出&&给出测试数据

AC代码#include <iostream>#include<cstdio>#include<algorithm>#include<math.h>#include<stdlib.h>using namespace std;int main(){ long long int a,b; int m; while(cin>>m) { if(m==0) break;

2021-03-01 22:47:41 108

原创 codeup - 打印日期 - 给出测试数据

AC代码// 以及需要的头文件int main(){ int m,n; while(cin>>m>>n){ int leap=isLeap(m); int i,d=0; for(i=1;;i++) { n=n-month[i][leap]; if(n<=0) { d=n+month[i][leap];

2021-02-18 20:09:19 131

原创 codeup - 入门模拟->日期处理 - 人间大迷惑

ac代码#include <iostream>#include<cstdio>#include<algorithm>#include<math.h>#include<cstring>#include<time.h>using namespace std;/*2013010120130105201302052013010120000101200101052013010120140105*/int

2021-02-17 21:35:34 108

原创 codeup 问题 B: Hello World for U

AC代码#include <iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int main(){ char str[1000]; cin>>str; int len=strlen(str); int a=len/3;// int b=len-2*a int b=le

2021-02-16 19:54:34 108

原创 虚拟机下linux20.04开机时进入initramfs无法开机

Linux系统之initramfs工作流程原因:没有正常关机导致磁盘文件损坏解决:输入exit打开机器,系统启动,一下子屏蔽闪出很多不应该看到的文字,最后停留在initramfs这里,这时如果运行exit可以进入系统,则说明rootdelay时间太短了.读反馈消息,是因为磁盘上/dev/sda3中的系统文件被损坏,需要手动用fsck修复一下根据提示,输入fsck /dev/sda3,看到一路Fix?,均输入y最后能看到"FILE SYSTEM WAS MODIFIED."的提示,修

2020-11-21 19:49:53 1149 1

原创 1002 A+B for Polynomials (25分) 测试用例+犯了所有可能犯的错误

原题1002 A+B for Polynomials (25分)This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:wh

2020-08-29 17:00:06 1858 4

原创 PAT 1001 A+B Format (20分)

通过代码#include<iostream>#include<cstdio>#include<string>#include<algorithm>#include<list>#include<string>using namespace std;bool gt(const int &a, const int &b) { return a>b;}int main() { in

2020-08-16 17:58:18 112

原创 PAT 1009 说反话 (20分)

通过代码#include<iostream>#include<cstdio>#include<string>#include<algorithm>#include<list>#include<string>using namespace std;int main() { string str; getline(cin,str); list<string> lst; strin

2020-08-16 17:16:05 234

原创 PAT 1008 数组元素循环右移问题 (20分)

通过代码#include<iostream>#include<cstdio>#include<string>#include<algorithm>#include<list>using namespace std;bool gt(const int &a, const int &b) { return a>b;}int main() { list<int> lst;

2020-08-15 15:23:58 108

原创 PTA 1006 换个格式输出整数 (15分)

#include<iostream>#include<cstdio>#include<string>#include<algorithm>using namespace std;int num[3];int main() { int n; int i=2; cin>>n; while(i>=0) { num[i] = n%10; n=n/10; i

2020-08-14 18:07:18 158

原创 git提交代码流程

git add .git commit -m "comment"git push -u origin yuhanyao

2020-08-14 17:38:15 118

原创 PAT 1005 继续(3n+1)猜想 (25分)

自拟测试点63 5 6 7 8 113:5 8 4 2 15:√6:3 (…√)但不算是被覆盖了,是关键数7:11 16 8 4 2 18:√11:√46 3 2 16:3 5 8 4 2 13:√2:√ans:647 4 9 127:11 16 8 4 2 14:√9:14 7 (7被覆盖)(…√)12:6 3 5 8 (…√)ans:7 9 12...

2020-08-14 17:36:00 184

原创 PAT 1004 成绩排名 (20分) 犯了所有可能犯的错误

原题1004 成绩排名 (20分)读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。输入格式:每个测试输入包含 1 个测试用例,格式为第 1 行:正整数 n第 2 行:第 1 个学生的姓名 学号 成绩第 3 行:第 2 个学生的姓名 学号 成绩 ... ... ...第 n+1 行:第 n 个学生的姓名 学号 成绩其中姓名和学号均为不超过 10 个字符的字符串,成绩为 0 到 100 之间的一个整数,这里保证在一组测试用例中没有两个学生的成绩

2020-08-14 15:51:33 340 1

原创 DELL戴尔笔记本没有break/pause键的解决方案

CTRL + FN + B

2020-06-30 12:29:08 3940

原创 数据结构 - 线性表、栈和队列 - 笔记

文章目录1. 线性表1.1 线性表的实现1.1.1 顺序表1.1.2 链表1.1.2.1 单链表1.1.2.2 双链表1.1.2.3 可利用空间表1.1.2.4 字典2. 栈2.1 顺序栈2.2 链式栈2.3 栈的应用2.3.1 栈实现递归2.3.2 栈实现进制转换2.3.3 栈实现平衡符号2.3.4 栈实现逆波兰(RPN)计算器2.3.5 [栈实现迷宫问题的解决](https://blog.cs...

2020-06-19 16:15:02 139

原创 数据结构 - 图 - 笔记

目录图的定义、实现与基本操作有关图的重要定义图的两种表示方式、ADT及其实现1.图的定义、实现与基本操作1.1 有关图的重要定义稀疏图,密集图,完全图标号图相邻的,邻接点权,带权图路径,简单路径,路径长度回路,简单回路子图连通的,连通分量(最大连通子图)无环图,有向无环图自由树1.2 图的两种表示方式、ADT及其实现使用哪种方式取决于边的数目密集图...

2020-06-19 16:14:04 320

原创 数据结构 - 二叉树 - 笔记

目录定义有关二叉树的重要定义二叉树的ADT遍历二叉树的方式1.定义1.1 有关二叉树的重要定义路径 - 长度 — 祖先 - 子孙深度:从根结点到该结点的路径长度树的高度=最深节点的深度+1结点的层数=深度 (根结点结点层数为0,深度为0)叶节点、内部节点(/分支节点)(定义有争议) 满二叉树:结点若是分支结点,定有两个非空子结点(定义无争议) 完全二叉树:从...

2020-06-19 16:13:28 555

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除