【问题标题】:Allowing pickle got multiple agruments允许泡菜有多个参数
【发布时间】:2019-12-19 19:18:08
【问题描述】:

昨天我成功地将 IMDB 数据集加载到我的 jupyter notebook 中,代码如下:

from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from tensorflow import keras
import numpy as np

# save np.load
np_load_old = np.load

# modify the default parameters of np.load
np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k)

imdb = keras.datasets.imdb

(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)

# restore np.load for future normal usage
np.load = np_load_old

现在他给了我错误:

TypeError: <lambda>() got multiple values for keyword argument 'allow_pickle'

我在这里缺少什么?

我也在关注这个thread。

【问题讨论】:

  • 当我重新启动内核时它可以工作,为什么我不能在同一个内核中运行这个命令两次?

标签: python numpy tensorflow


【解决方案1】:

您可以通过停止内核“重新启动运行时”来清除所有局部变量。它将清除任何先前分配给“allow_pickle”的值并解决此问题。

【讨论】:

    猜你喜欢
    • 2021-09-23
    • 2015-02-28
    • 1970-01-01
    • 2012-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多