목록머신러닝 (265)
스택큐힙리스트
나는 Siamese Neural Networks에 대해 꽤 새로운데 최근에 이 예제와 Colab 노트북을 찾았다. 코드를 실행할 때 다음과 같은 오류가 발생한다: IndexError: 0-D tensor의 잘못된 인덱스입니다. 0-D tensor를 Python 숫자로 변환하려면 tensor.item()을 사용하세요. 다음 줄에서: result=torch.max(res,1)[1][0][0][0].data[0].tolist() tensor.item()에 대한 정보를 발견했지만 여기서 어떻게 사용해야 할지 모르겠습니다. 편집:test_dataloader = DataLoader(test_dataset,num_workers=6,batch_size=1,shuffle=True) 정확도 = 0 카운터 = 0 정답 = ..
TensorFlow 1.10.1을 설치했지만, TensorFlow를 가져오려고 할 때 TensorFlow 버전 1.10.0이 필요하다는 메시지가 표시되었습니다. 그래서 해당 버전을 설치했고, 이제 다음과 같은 경고가 발생합니다:>>> import tensorflow C:\Users\PC\Anaconda3\envs\tut\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)ty..
--------------------------------------------------------------------------- IndexError Traceback (most recent call last) in ----> 1 return_gdf = gpd.sjoin(points_gdf, polys_gdf, how=inner, op='intersects') ~\AppData\Local\Continuum\anaconda3\lib\site-packages\geopandas\tools\sjoin.py in sjoin(left_df, right_df, how, op, lsuffix, rsuffix) 73 tree_idx = rtree.index.Index(stream) 74 ---> 75 idxmatc..
10,000개의 항목을 가진 큰 np 배열 'a'를 생성합시다. import numpy as np a = np.arange(0, 10000) 'n' 인덱스로 배열을 슬라이스합시다. 0->9, 1->10, 2->11 등 n = 32 b = list(map(lambda x:np.arange(x, x+10), np.arange(0, n))) c = a[b] 문제는 'n'이 32보다 작으면 IndexError: too many indices for array 오류가 발생한다는 것입니다. 'n'이 32 이상인 경우에는 코드가 완벽하게 작동합니다. 오류는 초기 배열의 크기나 개별 슬라이스의 크기에 관계없이 항상 숫자 32에서 발생합니다. 'n'이 1이면 코드가 작동합니다. 이것이 발생하는 원인에 대한 아이디어가 있..