Skip to content

Commit d5e3110

Browse files
author
MaryZolfaghar
committed
setting up the cuda
1 parent b39f9a4 commit d5e3110

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

analyze.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,11 @@ def analyze_cortical(model, test_data, args):
100100
# Get embeddings from model for each face
101101
model.eval()
102102
face_embedding = model.face_embedding
103+
face_embedding.to(args.device)
103104
embeddings = []
104105
with torch.no_grad():
105106
for idx in range(n_states):
106-
face_tensor = idx2tensor[idx].unsqueeze(0)
107+
face_tensor = idx2tensor[idx].unsqueeze(0).to(args.device)
107108
embedding = face_embedding(face_tensor) # [1, state_dim]
108109
embedding = embedding.cpu().numpy()
109110
embeddings.append(embedding)
@@ -133,4 +134,4 @@ def analyze_cortical(model, test_data, args):
133134

134135
results = {'pca': pca_results, 'correlation': correlation_results}
135136

136-
return results
137+
return results

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ def main(args):
100100
if __name__ == '__main__':
101101
args = parser.parse_args()
102102
print(args)
103-
main(args)
103+
main(args)

results.P

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)