原创 Python Error fix-YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated

報錯如下: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Pleas

原创 Python Error fix-ERROR:TypeError: _mean() got an unexpected keyword argument ‘dim‘

文章目錄TypeError: _mean() got an unexpected keyword argument 'dim'報錯解決【numpy中用axis和pytorch中用dim,因爲一個是numpy變量一個是tensor變

原创 PyTorch Error fix-UserWarning: Legacy autograd function with non-static forward method is deprecate

報錯如下: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3

原创 Linux--用history查看歷史命令

文章目錄history 用法彙總history——列出全部歷史命令history 數字#——列出最近的#條命令history -c——將目前shell中的所有history命令消除,對命令歷史文件沒有影響history -w——將

原创 VSCode之打開python終端 取消conda activate自動激活環境

文章目錄寫在前面方法一方法二 寫在前面 如果你一直需要用某個終端,還是建議方法一,省時省力 方法一 選擇自己想要的環境,後面再新建終端,就會默認這個環境 方法二 在 setting 的 json 文件裏改變 python.te

原创 PyTorch Error fix-IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim

報錯如下: IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number 報

原创 PyTorch Error fix 彙總

文章目錄1、IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim 1、IndexError: invalid index

原创 python之super()函數 #單類繼承&多類繼承 #super()使用debug過程

文章目錄描述語法python2和python3使用super()區別super()單類繼承super()多類繼承一個簡單的代碼示例super()使用debug過程 描述 super() 函數是用於調用父類(超類)的一個方法。 su

原创 python之def __init__(self)和def __init__(self, 參數1,參數2,···,參數n) #類中初始化形式的區別

文章目錄二者區別形式1:def __init__(self)形式2:def __init__(self, 參數1,參數2,···,參數n) 二者區別 class Student: #初始化形式1 def __init__

原创 pytorch函數之torch中的幾種乘法 #點乘torch.mm() #矩陣乘torch.mul(),torch.matmul() #高維Tensor相乘維度要求

文章目錄1. 點乘——`torch.mul(a, b)`2. 矩陣乘2.1. 二維矩陣乘——`torch.mm(a, b)`2.2. 高維矩陣乘——`torch.matmul(a, b)`3. 高維的Tensor相乘維度要求3.1

原创 pytorch之in-place operation #含義 #代碼示例 #兩種情況不能使用inplace operation

文章目錄一、in-place含義二、in-place代碼示例三、在pytorch中, 有兩種情況不能使用inplace operation第一種情況: requires_grad=True 的 leaf tensor第二種情況:

原创 推薦一個免費的截圖+貼圖(自動檢測界面元素區域,可標註,取色器,支持多屏,支持高分屏,歷史記錄回放等等)

Snipaste下載 鏈接1 鏈接2 Snipaste 是一個簡單但強大的截圖工具,也可以讓你將截圖貼回到屏幕上!下載並打開 Snipaste,按下 F1 來開始截圖,再按 F3,截圖就在桌面置頂顯示了。就這麼簡單!【快捷鍵也可以

原创 LINUX--創建新用戶&爲新用戶設置權限

文章目錄【一張圖總結】【詳細說明】1、登錄root2、新建用戶並創建家目錄3、更改爲bash命令4、設置密碼5、設置sudo權限【關於本文Linux命令的說明】1、`useradd -d /home/xpt -m xpt`2、`u

原创 Linux--screen遠程必備 #會話的創建、恢復、刪除(&重命名刪除)用法

文章目錄1. Screen簡介2. 常用screen參數2.1 創建會話2.2 查看有多少會話2.3 恢復會話2.4 刪除&(重命名怎麼刪) 1. Screen簡介 在Screen環境下,所有的會話都獨立的運行,並擁有各自的編號、

原创 pytorch之多GPU使用——#CUDA_VISIBLE_DEVICES使用 #torch.nn.DataParallel() #報錯解決

文章目錄0. 顯卡編號(什麼是主卡)1. 使用所有存在的顯卡2. 指定編號使用顯卡3. os.environ["CUDA_VISIBLE_DEVICES"]詳解3.1. ["CUDA_VISIBLE_DEVICES"]使用3.2.