关于旧基于xml的web服务项目从python2.7迁移到python3.6.2

https://www.jianshu.com/p/4e26007990f3 首先学一下前人经验

对git进行提交,然后在pycharm或者终端用conda 进行 activate的虚拟环境进行切换.

1其实最多的处理应该会是那些print了.

SyntaxError: Missing parentheses in call to 'print'

2因为原项目是一个面型图像处理的项目,所以编码问题应该几乎没有

3涉及到多线程问题

ModuleNotFoundError: No module named 'thread'

https://docs.python.org/2/library/thread.html 根据这篇文档,

将improt thread 改为 import _thread as thread

4 The SimpleXMLRPCServer module has been merged into xmlrpc.server standard module in Python3. (https://docs.python.org/3/library/xmlrpc.server.html)

Just do "from xmlrpc.server import SimpleXMLRPCServer"

5 同样的, SocketServer 在py3中被 renamed as socketserver

代码可以跑起来之后.运行业务测试代码.

报错的是  failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED

这就很奇怪了.. 这个是tensorflow的报错...

应该是我在另外的conda虚拟环境中 用pip3 install tensorflow-gpu=1.12.0引起的cuda 的新版本的设置问题,但我这台机还是cuda 8

重装tensorflow1.4搞定

测试通过~~~

猜你喜欢

转载自blog.csdn.net/dayuqi/article/details/85158198