是否有方法來檢查TensorFlow使用哪個protobuf實現(即,如果它使用的是C++版本還是Python版本)?TensorFlow檢查正在使用哪個protobuf實現
回答
@ keveman的回答告訴我們默認執行但不是活動執行。
重要的是,PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION
環境變量影響其實施是有效,因此
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp python -c "from google.protobuf.internal import api_implementation; print(api_implementation._default_implementation_type)"
和
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python -c "from google.protobuf.internal import api_implementation; print(api_implementation._default_implementation_type)"
將始終顯示同樣的結果。
要查看其執行是積極的,而不是使用:
python -c "from google.protobuf.internal import api_implementation; print(api_implementation.Type())"
更改PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION
環境變量將導致Type()
結果來改變它沒有爲_default_implementation_type
。
嘗試以下操作:
$ python -c "from google.protobuf.internal import api_implementation; print(api_implementation._default_implementation_type)"
應該打印要麼python
或cpp
。
謝謝!它說'python'。我假設我無法通過這種設置獲得最佳表現? – user3504575
我能夠通過簡單地重命名軟件包來安裝pip軟件包。 wget https://storage.googleapis.com/tensorflow/linux/cpu/protobuf-3.0.0b2.post2-cp34-none-linux_x86_64.whl mv protobuf-3.0.0b2.post2-cp34-none-linux_x86_64。 whl protobuf-3.0.0b2.post2-cp35-none-linux_x86_64.whl pip install x86_64.whl protobuf-3.0.0b2.post2-cp35-none-linux_x86_64.whl 它仍然說我正在使用'python'。這裏發生了什麼? – user3504575
- 1. 實現在TensorFlow
- 2. 我在哪裏可以找到一個RPC實現:boost + protobuf
- 3. 檢查哪些端口正在使用
- 4. 哪個JAXB實現使用?
- 5. 使用哪個int實現?
- 6. 在Anaconda上使用TensorFlow實現CNN
- 7. 檢查iOS中當前正在使用哪個相機應用
- 8. TensorFlow Conv2D實現?
- 9. 如何檢查我正在使用哪個GWT庫
- 10. 如何檢查我正在使用哪個Web服務?
- 11. 請檢查您目前正在使用哪個網址
- 12. 檢查哪個進程正在使用給定的端口
- 13. 我應該在哪裏使用protobuf
- 14. 使用Tensorflow實現卷積圖層
- 15. 用於segnet的tensorflow實現
- 16. 如何實現在tensorflow
- 17. Protobuf ParseDelimited從C++中實現
- 18. tensorflow Protobuf編譯問題
- 19. TensorFlow protobuf版本不匹配
- 20. Tensorflow爲張量創建Protobuf
- 21. 如何在protobuf中實現真正的可選字段?
- 22. 要使用哪個Tensorflow Docker鏡像?
- 23. 哪個GPU默認爲Tensorflow使用
- 24. 使用哪個查詢實現從Cassandra獲得一行
- 25. 哪個LOGO實現?
- 26. 正在檢索哪個用戶已經在某個地方進行了檢查
- 27. Swift 3檢查使用哪個segue
- 28. 如何檢查使用哪個segue
- 29. 使用datetime檢查哪一個更大
- 30. 我在哪裏使用TextWatcher實現?
解決了混亂!謝謝。 – user3504575
看來,如果從源代碼安裝,Tensorflow總是調用cpp protobuf。因爲在將PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION設置爲python之後,我仍然會得到「大於67108864字節的大協議消息...」。雖然protobuf 3.3.0應該使用BytesLimit = 2G。 – samuel