본문 바로가기
반응형

분류 전체보기282

[Errno 13] Permission denied: '/dev/ttyUSB0' serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'시리얼 포트에 대한 접근 권한이 없기 때문 `udev` 규칙을 사용하면 특정 장치에 대해 자동으로 권한을 설정할 수 있습니다. 예를 들어, `/etc/udev/rules.d/` 디렉토리에 새 규칙 파일을 생성하여 `/dev/ttyUSB0`에 대한 권한을 설정할 수 있습니다. 99-serial.rules 파일을 생성 sudo vi /etc/udev/rules.d/99-serial.rules  내용입력KERNEL="ttyUSB0", MODE="0666" udev 규칙 적용sudo udeva.. 2024. 5. 2.
[RPI] How to use Inductive Proximity Sensor with Raspberry Pi 3 Model B import timeimport RPi.GPIO as GPIO# Pin of InputGPIOpin = -1# Initial the input pindef initialInductive(pin): global GPIOpin GPIOpin = pin GPIO.setmode(GPIO.BCM) GPIO.setup(GPIOpin,GPIO.IN, pull_up_down=GPIO.PUD_DOWN) print("Finished Initiation") print(GPIOpin)# Detect Metaldef detectMetal(): if(GPIOpin != -1): state = GPIO.input(GPIOpin) if state: print("Metal Detected") e.. 2024. 4. 29.
[Python] How to Run 70B LLMs on a Single 4GB GPU https://generativeai.pub/how-to-run-70b-llms-on-a-single-4gb-gpu-d1c61ed5258c How to Run 70B LLMs on a Single 4GB GPUHave you ever dreamed of using the state-of-the-art large language models (LLMs) for your natural language processing (NLP) tasks, but felt…generativeai.pub   #https://generativeai.pub/how-to-run-70b-llms-on-a-single-4gb-gpu-d1c61ed5258cfrom airllm import AutoModelMAX_LENGTH = 128.. 2024. 4. 25.
[Python]Saving ML Models # https://machinelearningmastery.com/save-load-machine-learning-models-python-scikit-learn/# Save Model Using Pickleimport pandasfrom sklearn import model_selectionfrom sklearn.linear_model import LogisticRegressionimport pickleurl = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv"names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', .. 2024. 4. 25.
반응형