跳到主要內容

[Tensorflow] How to Install Tensorflow for C API

So many options for Tensorflow....
Tensorflow is a powerful deep learning suite that is now widely used in the development and application of various deep learning.
Although there are many users, if there are special projects that must install tensorflow on different versions / operating systems / programming languages / platforms, it is often necessary to find answers in the sea of google, and must continue to test after found.
Build form Source can basically solve most of the problems, but because it takes a lot of time and is difficult, it causes some people to have some difficulties in installation.
Here are a few of the tensorflow installation methods tested by myself.

Case1:  x86 | Python api | Windows & macOS & ubuntu

>> You can just easily follow tensorflow official tutorial:

= = =

Case2: x86 | C api | Windows & macOS & ubuntu

Step1. Download File by Platform:

>> Linux - CPU Only
>> Linux - GPU Support
>> macOS - CPU Only
>> Windows - CPU Only
>> Windows - GPU Support

Step2. Extract the File:

>> Linux & macOS
$ sudo tar -C /usr/local -xzf {File_Path}

Step3. Linker:


$ sudo ldconfig


Step4. Verify:

create a file name hello_tf.c and paste code below:
#include 
#include 

int main() {
  printf("Hello from TensorFlow C library version %s\n", TF_Version());
  return 0;
}
then compile hello_tf.c for check:
gcc hello_tf.c -ltensorflow -o hello_tf

./hello_tf


Done!

留言

這個網誌中的熱門文章

[python] python 常用套件

最近跑完 TCN 創客松後深感自己的不足,覺得不要再 Arduino 了,來重回 Python 的懷抱XD,複習了 Django 的書,順便列一下書裡面常見的套件,覺得之後會用到XD 網站框架 Django: 完整強大的 Web 框架 Pyramid: 強大 Web 框架2 web2py: Google app engine 預設框架 flask: 輕量 Web 框架,覺得有興趣。 圖片處理 PIL: 可對圖片進行縮放切割旋轉,圖片操作 Pillow: 因為 PIL 太久沒更新而出的 fork 版本,現在都用這個了 科學計算 Numpy: 神 Matplotlib: 出圖之神 pandas: 有點像 excel 的資料分析神 scikit-learn: 機器學習之神 命令列操作 fabric: 可以直接撰寫 shell 命令,透過 fabric 執行,也支持遠端登入和自定義 Shell  paramiko: 提供遠端登入和部分指定呼叫 測試 django-nose: Django 的測試套件 網路爬蟲 Scrapy: Python 爬蟲框架之一,可以輕易地和 Django 協作 文件叵析 beautifulsoup: 美麗的湯,處理 html, xml 文本分析一定要學的套件 lxml: 不太熟,但是聽說也很好用  自然語言處理 nltk: 理論基礎及功能強大的語言處理套件,但相對低階,上手困難 textblob: 較高階的分詞、分句語言分析工具 jieba: 中文分詞、分句、語言分析工具 網路請求用戶端 requests: 常用的網路請求工具,直觀好用 pycurl: 處理 linux, unix 系統上的命令 背景程序、定時任務 celery: 可以輕易編寫、呼叫非同步及背景程序,或是執行定時任務 資料庫介接 mysql-python: MySQL 的資料庫介接套件, Django 連接 MySQL 的預設 psycopg2: PostgreSQL 吃料庫介接套件 pymongo: MongoDB 的介接套件 自己常用的主要都在科學計算的部分,努力想要切入 scikit-learn 中 XD,但是又覺得網頁端 & 資料庫很重要R

[電銲] 自己的 IMU 自己焊!笨蛋的焊接法!

工程師真的是被要求包山包海都要會... IMU的組件被要求不能只插麵包板,要 "穩固的固定在另外製作的盒子裡",反正就是搞得跟外面幾十萬上下的 IMU 一樣精緻就是了。 好好好都焊給你~ 呃 對了 怎麼焊哈哈哈哈 ^^" 電焊這種技術自從上過國中的生活科技後就再也沒再用了@@,好家在這是個網路就是你家的時代,立刻上網查一查,找到一些關於焊槍使用的相關資料。 被要求說GY-91不能只接麵包板一定焊死才穩固所以就這樣接了

[python] 使用 python 控制 docx 範例

因為同事的需求,無職 a 我就又再度幫忙同事寫一些小程式。 這些小程式雖然簡單,但是聽到如果不幫忙寫程式解決,以手工作業的"大量人天" 的後果真的是讓人吐血。 他們有一份工作,需要產出一份很多很多很多資料圖片的判釋報告,要把數百張圖片剪裁成特定大小,加上圖說之後放入 word 裡面。 聽到的做法是...一張一張插圖!! wooow! That's really shocking me! 所以為了前公司同事的幸福,我還是加減寫一下好了。