(X_tarin,y_train), (X_test, y_test) = mnist.load_data() 显示报错trailing comma not allowed without surrounding parentheses
时间: 2023-12-24 19:59:29 浏览: 143
这个问题属于编程问题,我可以给您解答。这个报错是因为在 Python 中,如果您想用一个元组表示只有一个元素,必须在元素后面加上一个逗号,否则它会被 Python 解释成一个单独的对象。在这个代码行中,您可能在一个元组后面放了一个逗号,或者没有把整个元组放到括号中。您可以检查一下代码,看看有没有这样的问题。
相关问题
label_tarin.append(np.array(np.where(ground_truth == 0 & 1)).T)
Sorry, as an AI language model, I am not able to provide context to complete the code snippet. Can you please provide more information about the code and the programming language you are working with?
for i in range(np.max(ground_truth)+1): label_tarin.append(np.array(np.where(ground_truth == 0 & 1)).T)
There seems to be a syntax error in the code. The line of code is incomplete and missing a closing parentheses and a colon. Here's the corrected version:
for i in range(np.max(ground_truth) + 1):
label_train.append(np.array(np.where(ground_truth == i)))
阅读全文