2018-04-07 修改OpenEN坐漏,修改TF警告??

1. 修改 OpenEN

主要問(wèn)題:

(1)import 本地編寫(xiě)的py文件在路徑上有問(wèn)題

還有要注意工程之間的鏈接和應(yīng)用

一般都是相對(duì)路徑充岛,哦盹憎!

from libnrl.gcn.utils import *

(2)python版本修改

由于OpenEN是python2的敦姻,今天將open修改為pyrhon3.6版本

其中修改主要是print語(yǔ)句

for i in range(20):
    print('Iteration ', i)
Iteration  0
Iteration  1
Iteration  2
Iteration  3
Iteration  4
Iteration  5
Iteration  6
Iteration  7
Iteration  8
Iteration  9
Iteration  10
Iteration  11
Iteration  12
Iteration  13
Iteration  14
Iteration  15
Iteration  16
Iteration  17
Iteration  18
Iteration  19

把print('Iteration ', i)改為print 'Iteration ', i 就把python從2.7 改為了python3.6

對(duì)于這個(gè)問(wèn)題我只能2333333

一開(kāi)始打開(kāi)這個(gè)開(kāi)源項(xiàng)目瘾境,嚇了我一跳,怎么不能運(yùn)行镰惦,一看報(bào)print迷守,2333333

(3)安裝gensim

from gensim.models import Word2Vec?

一開(kāi)始還pip了半 天的Word2Vec,2333333

lijuncheng@lijunchengdeMacBook-Pro ~ $ pip install Word2Vec
Requirement already satisfied: Word2Vec in ./anaconda3/lib/python3.6/site-packages
Requirement already satisfied: numpy in ./anaconda3/lib/python3.6/site-packages (from Word2Vec)
Requirement already satisfied: cython in ./anaconda3/lib/python3.6/site-packages (from Word2Vec)
lijuncheng@lijunchengdeMacBook-Pro ~ $ python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct  6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Word2Vec
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Word2Vec'
>>> import Word2Vec
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Word2Vec'
>>> quit()
lijuncheng@lijunchengdeMacBook-Pro ~ $ pip install gensim
Collecting gensim
  Downloading gensim-3.4.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (22.8MB)
    100% |████████████████████████████████| 22.8MB 61kB/s
Requirement already satisfied: numpy>=1.11.3 in ./anaconda3/lib/python3.6/site-packages (from gensim)
Collecting smart-open>=1.2.1 (from gensim)
  Downloading smart_open-1.5.7.tar.gz
Requirement already satisfied: scipy>=0.18.1 in ./anaconda3/lib/python3.6/site-packages (from gensim)
Requirement already satisfied: six>=1.5.0 in ./anaconda3/lib/python3.6/site-packages (from gensim)
Requirement already satisfied: boto>=2.32 in ./anaconda3/lib/python3.6/site-packages (from smart-open>=1.2.1->gensim)
Collecting bz2file (from smart-open>=1.2.1->gensim)
  Downloading bz2file-0.98.tar.gz
Requirement already satisfied: requests in ./anaconda3/lib/python3.6/site-packages (from smart-open>=1.2.1->gensim)
Collecting boto3 (from smart-open>=1.2.1->gensim)
  Downloading boto3-1.7.2-py2.py3-none-any.whl (128kB)
    100% |████████████████████████████████| 133kB 496kB/s
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./anaconda3/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim)
Requirement already satisfied: idna<2.7,>=2.5 in ./anaconda3/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in ./anaconda3/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim)
Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/lib/python3.6/site-packages (from requests->smart-open>=1.2.1->gensim)
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->smart-open>=1.2.1->gensim)
  Downloading s3transfer-0.1.13-py2.py3-none-any.whl (59kB)
    100% |████████████████████████████████| 61kB 444kB/s
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->smart-open>=1.2.1->gensim)
  Downloading jmespath-0.9.3-py2.py3-none-any.whl
Collecting botocore<1.11.0,>=1.10.2 (from boto3->smart-open>=1.2.1->gensim)
  Downloading botocore-1.10.2-py2.py3-none-any.whl (4.2MB)
    100% |████████████████████████████████| 4.2MB 271kB/s
Requirement already satisfied: python-dateutil<2.7.0,>=2.1 in ./anaconda3/lib/python3.6/site-packages (from botocore<1.11.0,>=1.10.2->boto3->smart-open>=1.2.1->gensim)
Requirement already satisfied: docutils>=0.10 in ./anaconda3/lib/python3.6/site-packages (from botocore<1.11.0,>=1.10.2->boto3->smart-open>=1.2.1->gensim)
Building wheels for collected packages: smart-open, bz2file
  Running setup.py bdist_wheel for smart-open ... done
  Stored in directory: /Users/lijuncheng/Library/Caches/pip/wheels/cf/54/36/b003d8c2d26aadffc21f0677009ed53cf9575a97fc71fbba76
  Running setup.py bdist_wheel for bz2file ... done
  Stored in directory: /Users/lijuncheng/Library/Caches/pip/wheels/31/9c/20/996d65ca104cbca940b1b053299b68459391c01c774d073126
Successfully built smart-open bz2file
Installing collected packages: bz2file, jmespath, botocore, s3transfer, boto3, smart-open, gensim
Successfully installed boto3-1.7.2 botocore-1.10.2 bz2file-0.98 gensim-3.4.0 jmespath-0.9.3 s3transfer-0.1.13 smart-open-1.5.7

(4)測(cè)試運(yùn)行

python src/main.py --method node2vec --label-file data/blogCatalog/bc_labels.txt --input data/blogCatalog/bc_adjlist.txt --graph-format adjlist --output vec_all.txt --q 0.25 --p 0.25

python src/main.py --method gcn --label-file data/cora/cora_labels.txt --input data/cora/cora_edgelist.txt --graph-format edgelist --feature-file data/cora/cora.features  --epochs 200 --output vec_all.txt --clf-ratio 0.1

2.修改TF警告

警告??:

2018-04-07 17:54:07.725382: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2018-04-07 17:54:07.725402: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2018-04-07 17:54:07.725407: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-04-07 17:54:07.725412: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-04-07 17:54:07.725417: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

警告原因好像是由于:什么指令集不對(duì)怎么樣
TensorFlow CPU環(huán)境 SSE/AVX/FMA 指令集編譯
在StackOverflow上找到相關(guān)解釋:https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions

解決:添加兩行代碼

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

效果


接下來(lái)還有繼續(xù)跟進(jìn)對(duì)NE的學(xué)習(xí)旺入,加油兑凿。距離月底還有22天凯力,希望盡快形成有小論文的想法。加油??礼华,加油??咐鹤,加油??....

寶寶明天要上班啦,希望寶寶每天都開(kāi)心圣絮,快樂(lè)祈惶。少生點(diǎn)氣,其實(shí)生活很美好??????

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末扮匠,一起剝皮案震驚了整個(gè)濱河市捧请,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌棒搜,老刑警劉巖疹蛉,帶你破解...
    沈念sama閱讀 216,692評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異帮非,居然都是意外死亡氧吐,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,482評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門(mén)末盔,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)筑舅,“玉大人,你說(shuō)我怎么就攤上這事陨舱〈浼穑” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 162,995評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵游盲,是天一觀的道長(zhǎng)误墓。 經(jīng)常有香客問(wèn)我,道長(zhǎng)益缎,這世上最難降的妖魔是什么谜慌? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,223評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮莺奔,結(jié)果婚禮上欣范,老公的妹妹穿的比我還像新娘。我一直安慰自己令哟,他們只是感情好恼琼,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,245評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著屏富,像睡著了一般晴竞。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上狠半,一...
    開(kāi)封第一講書(shū)人閱讀 51,208評(píng)論 1 299
  • 那天噩死,我揣著相機(jī)與錄音颤难,去河邊找鬼。 笑死甜滨,一個(gè)胖子當(dāng)著我的面吹牛乐严,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播衣摩,決...
    沈念sama閱讀 40,091評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼昂验,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了艾扮?” 一聲冷哼從身側(cè)響起既琴,我...
    開(kāi)封第一講書(shū)人閱讀 38,929評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎泡嘴,沒(méi)想到半個(gè)月后甫恩,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體樊诺,經(jīng)...
    沈念sama閱讀 45,346評(píng)論 1 311
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡匣砖,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,570評(píng)論 2 333
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了扮宠。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片抛虫。...
    茶點(diǎn)故事閱讀 39,739評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡松靡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出建椰,到底是詐尸還是另有隱情雕欺,我是刑警寧澤,帶...
    沈念sama閱讀 35,437評(píng)論 5 344
  • 正文 年R本政府宣布棉姐,位于F島的核電站屠列,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏伞矩。R本人自食惡果不足惜笛洛,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,037評(píng)論 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望乃坤。 院中可真熱鬧苛让,春花似錦、人聲如沸侥袜。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,677評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)枫吧。三九已至,卻和暖如春宇色,著一層夾襖步出監(jiān)牢的瞬間九杂,已是汗流浹背颁湖。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,833評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留例隆,地道東北人甥捺。 一個(gè)月前我還...
    沈念sama閱讀 47,760評(píng)論 2 369
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像镀层,于是被迫代替她去往敵國(guó)和親镰禾。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,647評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容