小编Phi*_*key的帖子

ImportError:动态模块没有定义模块导出函数(PyInit__caffe)

我用python3安装caffe,但是当我导入caffe时,我得到了一些错误Traceback(最近一次调用最后一次):

 File "classify.py", line 14, in <module>
    import caffe
  File "/home/hez/caffe-master/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver
  File "/home/hez/caffe-master/python/caffe/pycaffe.py", line 13, in <module>
    from ._caffe import Net, SGDSolver
ImportError: dynamic module does not define module export function (PyInit__caffe)
Run Code Online (Sandbox Code Playgroud)

但它在python2.7中运行良好.

我已经将/ path/to/caffe/distrubute/python添加到PATH,但是当我创建pycaffe时,它显示了

make: Nothing to be done for `pycaffe'.
Run Code Online (Sandbox Code Playgroud)

我怎么解决这个问题?非常感谢你.

python neural-network deep-learning caffe

8
推荐指数
1
解决办法
3万
查看次数

为什么mouseMoveEvent在PyQt5中什么都不做

我尝试在PyQt5和Python3.5中使用mouseMoveEvent和mousePressEvent,但是当我单击鼠标时没有任何内容.我的代码如下,有什么问题吗?

from PyQt5 import QtWidgets, QtGui, QtCore

class Window(QtWidgets.QMainWindow):
    def __init__(self):
        QtWidgets.QMainWindow.__init__(self)
        widget = QtWidgets.QWidget(self)
        layout = QtWidgets.QVBoxLayout(widget)
        self.graphicsView = QtWidgets.QGraphicsView()
        self.graphicsView.setCursor(QtCore.Qt.CrossCursor)
        self.graphicsView.setObjectName("graphicsView")
        layout.addWidget(self.graphicsView)
        self.setCentralWidget(widget)

    def mouseMoveEvent(self, event):
        if event.buttons() == QtCore.Qt.NoButton:
            print("Simple mouse motion")
        elif event.buttons() == QtCore.Qt.LeftButton:
            print("Left click drag")
        elif event.buttons() == QtCore.Qt.RightButton:
            print("Right click drag")

    def mousePressEvent(self, event):
        if event.button() == QtCore.Qt.LeftButton:
            print("Press!")

if __name__ == '__main__':
    import sys
    app = QtWidgets.QApplication(sys.argv)
    win = Window()
    win.show()
    sys.exit(app.exec_())
Run Code Online (Sandbox Code Playgroud)

python pyqt python-3.x pyqt5

1
推荐指数
1
解决办法
5295
查看次数

标签 统计

python ×2

caffe ×1

deep-learning ×1

neural-network ×1

pyqt ×1

pyqt5 ×1

python-3.x ×1