预期得到2个值,但实际得到0个

您好,我想知道当预期接收两个值却什么也没得到时,该如何解决这个问题?此外,我尝试运行这个GitHub上的代码,但遇到了许多错误。代码可以在https://github.com/CSAILVision/IBD查看

我尝试删除下划线字符并编辑代码,以便没有红色下划线阻止其运行

import osimport settingsfrom loader.model_loader import loadmodelfrom util.feature_operation import FeatureOperatorfrom util.clean import cleanfrom util.feature_decoder import SingleSigmoidFeatureClassifierfrom util.image_operation import *from PIL import Imageimport numpy as npfrom imageio import imreadfrom visualize.plot import random_colorfrom torch.autograd import Variable as Vimport torchmodel = loadmodel()fo = FeatureOperator()features, _ = fo.feature_extraction(0)for layer_id, layer in enumerate(settings.FEATURE_NAMES):    feat_clf = SingleSigmoidFeatureClassifier(feature=features[layer_id], layer=layer, fo=fo)    feat_clf.load_snapshot(14, unbiased=True)data_loader.py:156: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.  result[list(np.indices(arr.shape)) + [arr]] = 1loading features layer4Traceback (most recent call last):  File "test.py", line 26, in <module>    features, _ = fo.feature_extraction(0)ValueError: not enough values to unpack (expected 2, got 0)

回答:

阅读代码和错误信息:

features, _ = fo.feature_extraction(0)...not enough values to unpack (expected 2, got 0)

您试图分配两个值,但feature_extraction根本没有返回任何值。是否需要重新查看文档和使用说明?

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注