我正在华盛顿大学Coursera的机器学习课程中学习。我在其中使用iPython的graphlab。在练习期间,当我执行以下命令时:

sales = graphlab.SFrame('home_data.gl/')


我收到错误消息:

InvalidProductKey                         Traceback (most recent call last)
<ipython-input-3-c5971b60b216> in <module>()
----> 1 sales=graphlab.SFrame('home_data.gl/')

/opt/conda/lib/python2.7/site-packages/graphlab/data_structures/sframe.pyc in __init__(self, data, format, _proxy)
865             self.__proxy__ = _proxy
866         else:
--> 867             self.__proxy__ = UnitySFrameProxy(glconnect.get_client())
868             _format = None
869             if (format == 'auto'):

/opt/conda/lib/python2.7/site-packages/graphlab/connect/main.pyc in get_client()
138     """
139     if not is_connected():
--> 140         launch()
141     assert is_connected(), ENGINE_START_ERROR_MESSAGE
142     return __CLIENT__

/opt/conda/lib/python2.7/site-packages/graphlab/connect/main.pyc in launch(server_addr, server_bin, server_log, auth_token, server_public_key)
 90         if server:
 91             server.try_stop()
 ---> 92         raise e
 93     server.set_log_progress(True)
 94     # start the client

 InvalidProductKey: Product key not found.


(请注意,ipython笔记本和home_data.gl位于同一文件夹中。)

最佳答案

您将需要使用以下命令为graphlab设置产品密钥
graphlab.product_key.set_product_key('PRODUCT KEY HERE')

关于machine-learning - graphlab.SFrame('home_data.gl/')中的错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39092563/

10-12 03:26