Setting, Error/Python, Python Library 23

command에서 파일 복사 안 될 때, python으로 해결하는 법

▼ 에러 상황 - Window 운영체제 사용 - cmd 및 powershell에서 copy, xcopy 를 사용하여 파일 및 폴더를 복사하려 하였으나, 올바른 경로, 위치가 아니라는 에러 발생 - 특정 이름을 포함한 파일들만 복사하고 싶었기 때문에, 폴더 안에 들어가서 바로 복사하는 것은 불가능함 ☞ python의 shutil 사용 import shutilfrom glob import globoriginal_path = glob('C:/Users/user/바탕 화면/Travel Log/*제주도*')copy_path = 'C:/Users/user/바탕 화면/'for op in original_path: shutil.copy(op, copy_path) 여기서 original_path에는 내가 원..

Jupyter notebook terminal 문제 해결

문제 1. 터미널에서 방향키 안 됨문제 2. 터미널에서 자동완성 tab 안 됨▶ 해당 문제는 주피터 terminal이 dash 터미널이기 때문이다. [해결 1]. 주피터 터미널을 사용할 때마다 bash 명령어 입력하기 - 매번 terminal을 켜서 bash를 입력해야하는 불편함이 있음 [해결 2] 주피터 config 설정 바꾸기 2-1. 주피터 환경설정 파일 수정 $ vi /root/.jupyter/jupyter_lab_config.py 주피터 설정 파일 경로 확인법 리눅스에서 주피터 환경설정 파일 찾기$ jupyter --paths 모든 config 파일은 .jupyter 경로 아래에 저장되므로여기에서 제일 위의 /root/.jupyter 경로를 들어가면 된다.develop-ds.tistory.com..

Python Structure 사용법

0. Dict 에서의 사용법AttributeError: 'dict' object has no attribute 'dataset'  파이썬의 Dict는 안의 객체를 참조할 때 . 으로 참조할 수 없다. configs = {   'dataset' : 'electricity'} configs.dataset 이라고 하면 위와 같은 에러가 난다.--> configs['dataset'] 으로 코드를 수정해야 한다.   1. Python Structure 객체지향적으로 python을 사용하고 싶다면 Decoration을 사용해야 한다. 1.1 Decoration을 import 한다.- from dataclasses import dataclass @dataclassclass Configs:    dataset:str ..

Cleverhans 사용법

Adversarial Attack의 각종 공격기법들을 구현해놓은 Python Library [Cleverhans] 사용법 정리Torch, TF2 에서 사용 가능출처 : https://github.com/cleverhans-lab/cleverhans Cleverhans - API documentshttps://cleverhans.readthedocs.io/en/latest/ Cleverhans - Bloghttps://www.cleverhans.io/ Cleverhans - Githubhttps://github.com/cleverhans-lab/cleverhans Cleverhans Code - Paperhttps://arxiv.org/pdf/1610.00768 추후, 각각의 공격기법들에 대해서 Study..