發表文章

目前顯示的是 2020的文章

[C++, Visual Studio] 解決問題 : 應用程式無法正確啟動 (0xc000007b)。請按一下 [確定] 關閉應用程式。

這問題是幾個禮拜前發生且解決的問題,在此先做個筆記紀錄。 使用 Visual Studio 2015 編譯C++時跑出," 應用程式無法正確啟動 (0xc000007b)。請按一下 [確定] 關閉應用程式。 "。 解法 :  64位元 : 進入 C:\Windows\SysWOW64,網路上下載最新的 "vcruntime140.dll"以及"vccorlib140.dll"。 應該是這兩個沒錯,若有錯我會在補正。

[Deep Learning] 如何解決梯度消失 ( Gradient Vanishing) ?

Why : 激勵函數使用 sigmoid function, 因Chain Rule法則, 會使得激勵函數之導數無限相乘會越來越小, 無法更新到接近input layer的weight, 稱為梯度消失。 How : Activation function改用Relu 改用ResNet和Batch normalization 網路不要太深

[Python, Pyinstaller] Pyinstaller 打包出現 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position

Pyinstaller 打包 exe 檔案時,出現以下錯誤訊息 : UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position  GOOGLE 一下,解決方法如下 : 將 Pyinstaller 資料夾內的 compat.py找出來。 大約第370行, 將下列程式行更改 out = out.decode(encoding) out = out.decode(encoding, errors='ignore') 還有一種方法是在cmd先下指令 chcp 65001 python pyinstaller ...

[Ubuntu, Wine, Winetricks] 安裝Wine、Winetricks

若是要將windows的資料傳至vm上的ubuntu,需先安裝ssh並輸入傳輸指令 sudo apt install ssh openssh-server pscp -r "目標資料夾" 使用者名稱@IP:資料夾名稱 pscp -r C:\Users\neto427\source\repos\contrel_k5_001 ubuntu@192.168.80.135:monoDotNet 新增key、wine依賴庫,更新並安裝,最後檢查版本 wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main' sudo apt update sudo apt install --install-recommends winehq-stable  // 安裝相關依賴 wine --version 由於apt上的winetricks版本過舊,因此要用別的方式去下載安裝最新版 sudo apt remove winetricks //移除舊版winetricks sudo wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks sudo chmod +x winetricks //修改為可執行 sudo mv -v winetricks /usr/local/bin //將可執行文件放置在可調用的目錄底下 接著下指令去執行windows執行檔,過程中可能會安裝一些mono相關的程式,直接安裝即可 wine xxx.exe 若發現缺少DLL,執行winetricks去下載缺少所缺少的DLL,就目前自己開發的專案所缺少的有以下 MS.NET4.0 (dotnet40) Wine的路徑如下,如同windows目錄 ~/.wine

[Python, pip] AttributeError: module 'clr' has no attribute 'AddReference'

想使用 DLL 文件, 需使用 clr 內的 AddReference 的函式, 因此我下了這個指令 : pip install clr 下了以後發現都會跑出 : AttributeError: module 'clr' has no attribute 'AddReference' 原來會噴錯的原因是因為我裝了 'clr', 其實只要安裝pythonnet即可。 pip uninstall clr pip install pythonnet

[Python, pip] ModuleNotFoundError: No module named 'pkg_resource.py2_warn'

建置 python 的 exe 執行檔時出現 ModuleNotFoundError: No module named 'pkg_resource.py2_warn'  檢查以後發現, 自己的setuptools版本是45.0.0, 降版本以後即可。 pip install setuptools==44.0.0

[TensorFlow, C++, Visual Studio, Windows] TensorFlow C++ 於 Visual Studio 快速使用 DLL,LIB 流程

圖片
很久之前寫過一篇關於編譯TensorFlow C++ 的流程,如下: [TensorFlow, C++, Visual Studio, Windows] TensorFlow C++ 如何編譯與解決BUG (How to build Tensorflow C++ API with Visual Studio and solve BUG) [CMake, TensorFlow, C++, Python] 使用CMake去編譯TensorFlow所要知道的事情... 現在回過頭來看, 其實寫得很不詳細, 主要是寫出當時所處理的BUG以及處理方式。 最近在網路上找到一位善心人士, 將自己所編譯好的 TensorFlow C++ LIB和DLL 檔釋出, 這邊分享這位善心人士 fo40225 的github。 https://github.com/fo40225/tensorflow-windows-wheel 裡面目前只有兩個版本有C++的dll以及lib, r1.10.0 (CPU版本以及GPU版本)和r1.14.0(CPU版本) , 裡面有cpp資料夾, 請參閱所需之cuda和cudnn下載。 以r1.10.0為例,流程如下 : 此github下面有說明其兼容的cuda版本和cudnn版本,對照並下載對應版本。 到此網站針對需求,CPU或GPU去下載分散的壓縮檔。 https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.10.0/cpp 解壓縮完畢後有三個資料夾,bin、include、lib。 進入Visual Studio 創建空專案,並針對屬性頁新增 VC++目錄->include目錄->"include"資料夾位置 VC++目錄->程式庫目錄->"lib"資料夾位置 連結器->其他相依性->"tensorflow.lib; tensorflow_static.lib" 將bin/tensorflow.dll丟置空專案底下或是System32底下 確定cuda有輸入至環境變數

[C++] 淺談 i++ 與 ++i 之效率問題

出社會後才發現i++與++i在效率上的差別,簡單來說... i++ Compiler 會產生一個位置去暫存i的值 ++i 直接返回i的值