반응형 ValueError1 ValueError: shapes (100,) and (1,100) not aligned: 100 (dim 0) != 1 (dim 0) ValueError: shapes (100,) and (1,100) not aligned: 100 (dim 0) != 1 (dim 0)¶ dot, cosine_similarity 등 매트리스끼리 연산할때, 두 매트리스의 shape가 연산규칙에 맞지 않다면 ValueError 가 발생하네요. In [1]: import numpy as np (100) X (1,100) 어레이는 에러가 산출되네요 In [2]: a = np.random.rand(100) b = np.random.rand(1, 100) np.dot(a, b) --------------------------------------------------------------------------- ValueError Traceback (most re.. 2024. 3. 23. 이전 1 다음 반응형