小编Geo*_* Ng的帖子

Streamlit Web 应用程序上的序列化机器学习模型(pickle)会引发错误

我建立了一个爱彼迎机器学习模型来预测新加坡的价格。使用 pickle,我在 python 3.9 中序列化了经过训练的模型并将其推送到 github。

位于此处的 Streamlit Web 应用程序 - https://just4jc-singapore-airbnb-new-streamlit-app-khwftb.streamlit.app/工作了一段时间,最近抛出了一个错误。

Traceback (most recent call last):

      File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script

        exec(code, module.__dict__)

      File "/app/singapore-airbnb/new.py", line 119, in <module>

        rf = pickle.load(file)

      File "sklearn/tree/_tree.pyx", line 714, in sklearn.tree._tree.Tree.__setstate__

      File "sklearn/tree/_tree.pyx", line 1418, in sklearn.tree._tree._check_node_ndarray

    ValueError: node array from the pickle has an incompatible dtype:

    - expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, …
Run Code Online (Sandbox Code Playgroud)

pickle streamlit

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

在Mac上安装Bazel Release 0.1.2

我在安装了Xcode 7.2和JDK 8的Mac OS X 10.11.12上安装tensorflow.

我按照这里的说明进行操作 - http://bazel.io/docs/install.html

$ chmod +x install-_version-os.sh_
$ ./install-version-os.sh --user
Run Code Online (Sandbox Code Playgroud)

并已下载该文件 bazel-0.1.2-installer-darwin-x86_64.sh

在给定下载文件的文件名的情况下,如何键入上述说明?

谢谢.

乔治

macos bazel tensorflow

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

标签 统计

bazel ×1

macos ×1

pickle ×1

streamlit ×1

tensorflow ×1