报错 ValueError: too many values to unpack (expected 2)

简介: 报错 ValueError: too many values to unpack (expected 2)
enc_output,enc_slf_attn  = self.slf_attn(user_embedding,item_input,item_input,mask  = slf_attn_mask)


实际上只有一个返回值,但是却写了两个返回值,所以报错。


改正为


enc_output  = self.slf_attn(user_embedding,item_input,item_input,mask  = slf_attn_mask)


目录
相关文章
|
10月前
|
Python
Python报错ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Python报错ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
|
12月前
|
程序员 Go API
译|Errors are values
译|Errors are values
55 0
ValueError: not enough values to unpack (expected 3, got 2)
这个错误通常是因为在解包(unpacking)元组(tuple)时,元组中的元素数量与期望不符,导致无法将所有元素正确解包。 例如,在以下代码中,元组中只有两个元素,但我们尝试将其解包为三个变量:
467 0
|
TensorFlow 算法框架/工具
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
243 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
报错:pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 7, saw 2
报错:pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 7, saw 2
报错:pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 7, saw 2
解决办法: error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]
解决办法: error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]
191 0
|
Python
SyntaxError: Missing parentheses in call to 'print'
SyntaxError: Missing parentheses in call to 'print'
116 0
|
存储 索引
成功解决ValueError: If using all scalar values, you must pass an index
成功解决ValueError: If using all scalar values, you must pass an index
成功解决pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 49, saw 2
成功解决pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 49, saw 2