TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #201 · 13 јан.

Мы уже знаем, что на текущую сессию интерпретатора изменение PYTHONPATH никак не повлияет. Но если вы запустите дочерний процесс, то он унаследует окружение текущего процесса, а значит и изменения в любых переменных будут на него влиять. Вот небольшой пример: Объявляем переменную user@host:~$ export PYTHONPATH=/path1 Запускаем интерпретатор user@host:~$ python3 Проверим что в sys.path >>> import sys >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Добавляем что-то в переменную >>> import os >>> os.emviron['PYTHONPATH'] = '/path1:/path2' >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Изменений нет. Но давайте запустим дочерний процесс и посмотрим там >>> os.system('python3') # теперь мы находимся в другом процессе >>> import sys >>> print(sys.path) ['', '/path1', '/path2', '/usr/lib/...', ...] Тоже самое будет и с subprocess, так как по умолчанию текущее окружение тоже наследуется. >>> import subprocess >>> subprocess.call(['python3', '-c', 'import sys;print(sys.path)']) ['', '/path1', '/path2', '/usr/lib/...', ...] ______________________ Лучшей практикой является передача энвайронмента явно через аргумент env! import subprocess subprocess.call(cmd, env={'PYTHONPATH': '...'}) Это поможет точно понимать какое окружение будет у запускаемого процесса и при этом не изменять окружение текущего процесса. #basic

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #toyotarobots

当前筛选 #toyotarobots清除筛选
AI & Law

@ai_and_law · Post #120 · 24.09.2023 г., 09:18

🌟AI Sunday Wonders: Toyota's Breakfast Bots Show How Robots Learn Welcome to AI Sunday Wonders! This week, we're diving into the fascinating world of AI-powered robots, and Toyota has a delightful story to share. Toyota Research Institute (TRI) has introduced the concept of a "kindergarten for robots." But here's the twist: these robots are learning to make breakfast! Traditionally, teaching robots complex tasks required extensive coding and debugging. However, TRI is taking a different approach. By giving robots a sense of touch, they allow the robots to "feel" their actions, making learning easier. Here's how it works: A "teacher" initially demonstrates a set of skills, and then, over a few hours, the AI model learns in the background. Imagine teaching a robot in the afternoon and coming back the next morning to find it mastering a new skill. Toyota aims to create "Large Behavior Models" (LBMs) for robots, allowing them to generalize new skills based on observed patterns, similar to how AI models learn from human writing patterns. They've already trained robots in over 60 challenging skills and plan to reach 1,000 by 2024. Toyota isn't alone in this endeavor; Google and Tesla are also making strides in AI training for robots. Imagine the possibilities: AI-trained robots that can perform tasks with minimal instruction, just like humans. #AISundayWonders#ToyotaRobots#AIInnovation