반응형

반응형

 

문제

현재 mac m1 pro 사용중에 from tensorflow.keras.models import Sequential 호출해서 사용하는데

Failed to get CPU frequency: 0 Hz error가 발생했습니다.

 

 

해결

원인은 GPU를 사용하다 m1 pro에는 gpu 설정하는게 달라 발생하는 에러인거 같습니다.

그래서 tf.config.set_visible_devices() 사용해서 CPU만 사용하도록 수정했습니다.

tf.config.set_visible_devices([], 'GPU')

저는 이렇게 설정하니 에러가 해결되었습니다.

https://infoinhere.tistory.com/60

 

tf.config.set_visible_devices()

tf.config.set_visible_devices()이란? tf.config.set_visible_devices( devices, device_type=None ) device는 실제 GPU 장비의 이름이 들어가고, device_type에는 CPU 또는 GPU를 넣습니다. 만약 CPU만 사용할려면 device에 빈 리스트

infoinhere.tistory.com

 

반응형

'머신러닝 & 딥러닝' 카테고리의 다른 글

SVM  (0) 2023.05.14
Feature space  (0) 2023.05.14
tf.config.set_visible_devices()  (0) 2023.05.06
[library] seaborn  (0) 2023.04.28
AUC란?  (0) 2023.04.26
반응형
반응형

tf.config.set_visible_devices()이란?

tf.config.set_visible_devices(
    devices, device_type=None
)

device는 실제 GPU 장비의 이름이 들어가고, device_type에는 CPU 또는 GPU를 넣습니다.

 

만약 CPU만 사용할려면 device에 빈 리스트를 넣고 device_type에는 GPU를 넣으면 됩니다

예시) tf.config.set_visible_devices([], 'GPU')

 

반응형

'머신러닝 & 딥러닝' 카테고리의 다른 글

Feature space  (0) 2023.05.14
Failed to get CPU frequency: 0 Hz  (0) 2023.05.06
[library] seaborn  (0) 2023.04.28
AUC란?  (0) 2023.04.26
ModuleNotFoundError: No module named ""  (0) 2023.04.25
반응형
반응형

Jupyter Notebook not trusted

 

상황

Jupyter Notebook에서 파일을 열었을 때 Not trusted error가 발생하는 상황입니다.

 

해결

jupyter notebook을 열 때 jupyter trust로 열면 해결된다고 하는데.. 해결되지 않았습니다.

다른 방법으로는 아웃풋을 다 삭제 후 다시 노트북을 여는건데 아웃풋을 삭제하지 않고 열 수 있는게 좋을꺼 같아 시도해보지 않았습니다.

 

 

반응형

'IT' 카테고리의 다른 글

SOAP이란?  (0) 2023.05.11
[git]There isn’t anything to compare  (0) 2023.05.08
'list' object is not callable  (0) 2023.04.23
fatal: 관계 없는 커밋 내역의 병합을 거부합니다  (0) 2023.04.20
fatal: couldn't find remote ref master  (0) 2023.04.20
반응형
반응형

fend someone off

Cambridge Dictionary

- to push or send away an attacker or other unwanted person

 

person

1. a man, woman, or child: 2. used when describing someone's character: 3. If…

dictionary.cambridge.org

 

fend off라는 뜻에 꼭 공격자나 원하지 않는 사람을 밀어내다는 뜻으로만 사용되지 않고

원하지 않는 말 또는 사물을 밀어낼 때도 사용할 수 있습니다.

 

예시로 "Don't fend off questions about family."

가족에 대한 질문을 피하지 말라는 의미입니다.

반응형

'영어 > 오늘의 영어단어' 카테고리의 다른 글

anticlimactic  (0) 2023.05.04
out of thin air  (0) 2023.04.25
Pound of Flesh  (0) 2023.04.25
cough something up / cough it up  (1) 2023.04.19
Mum's the word 이란?  (0) 2023.04.16
반응형
반응형

 

anticlimactic이란?

 

빅뱅이론을 보던 중에 레널드와 페니가 갑작스럽게 약혼하는 사이가 되었을 때 레널드가 "It feels a little anticlimactic"이라고 합니다.

번역으로는 "김빠진다"라고 했는데 상황에 맞게 한국어로 잘 번역한거 같습니다.

이외에도 기대에 못 미치는 상황이면 Its a anticlimactic 이라고 표현하면 됩니다~.

 

 

 

 

 

 

출처

https://dictionary.cambridge.org/dictionary/english/anticlimactic

 

anticlimactic

1. If an event or experience is anticlimactic it causes disappointment because…

dictionary.cambridge.org

 

반응형

'영어 > 오늘의 영어단어' 카테고리의 다른 글

fend someone off  (0) 2023.05.05
out of thin air  (0) 2023.04.25
Pound of Flesh  (0) 2023.04.25
cough something up / cough it up  (1) 2023.04.19
Mum's the word 이란?  (0) 2023.04.16
반응형
반응형

문제

glob()을 통해 파일을 가져올려고 하는데 TypeError: path should be path-like or io.BytesIO, not <class 'list'> 발생했습니다.

 

코드

sign = list(test_path.glob(f'{i}/*'))

 

예상 원인

뒤에 따라오는 from tensorflow.keras.preprocessing.image import load_img 에서 에러가 발생하고 있었습니다.

 

해결

load_img() 함수에 list를 넣어서 발생한거 같아 수정했더니 에러가 발생하지 않았습니다.

 

* load_img()

tf.keras.utils.load_img(
    path,
    grayscale=False,
    color_mode='rgb',
    target_size=None,
    interpolation='nearest',
    keep_aspect_ratio=False
)
반응형
반응형
반응형

zip(*iterables, strict=False)

  • 동일한 개수로 이루어진 iterable한 객체들(iterables)을 인수로 받아 묶어서 iterator로 반환합니다.

예시 코드)

for itemin zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):
	print(item)
    
(1, 'sugar')
(2, 'spice')
(3, 'everything nice')
반응형

'Python' 카테고리의 다른 글

print 하면 <map object at 0x10446d880> 나올 때  (0) 2023.06.01
[python] list 사용 방법  (0) 2023.05.29
combinations()  (0) 2023.05.03
[panda]info()  (0) 2023.04.26
cannot import name 'fl_score' from 'sklearn.metrics'  (0) 2023.04.26
반응형
반응형

 

itertools.combinations(iterable, r)

  • 파이썬의 combinations은 itertools 라이브러리를 호출해서 사용할 수 있습니다.
  • iterable은 member를 하나씩 반환할 수 있는 object를 말하며, 예로는 sequence type인 list, str, tuple이 있습니다.

 

예시 코드)

combinations('ABCD', 2) --> AB AC AD BC BD CD
combinations(range(4), 3) --> 012 013 023 123
반응형

'Python' 카테고리의 다른 글

[python] list 사용 방법  (0) 2023.05.29
zip()  (0) 2023.05.03
[panda]info()  (0) 2023.04.26
cannot import name 'fl_score' from 'sklearn.metrics'  (0) 2023.04.26
IndentationError: unindent does not match any outer indentation level  (0) 2023.04.25

+ Recent posts