Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run discrete or continous file #25

Open
SExpert12 opened this issue Jul 4, 2024 · 0 comments
Open

Not able to run discrete or continous file #25

SExpert12 opened this issue Jul 4, 2024 · 0 comments

Comments

@SExpert12
Copy link

Hi,
When I run the continous file I got this error:

##################################################################################################
python continuous_driver.py --exp-name ppo --town Town07
##################################################################################################
Couldn't import Carla egg properly
pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
ERROR:root:Connection has been refused by the server.

Exit
Traceback (most recent call last):
File "continuous_driver.py", line 330, in
runner()
File "continuous_driver.py", line 146, in runner
env = CarlaEnvironment(client, world,town)
UnboundLocalError: local variable 'client' referenced before assignment

##################################################################################################

As I am getting error related to egg file. I also add these lines in the continous flie:
try:
import pygame
except ImportError:
raise RuntimeError('cannot import pygame, make sure pygame package is installed')

try:
import numpy as np
except ImportError:
raise RuntimeError('cannot import numpy, make sure numpy package is installed')
except ImportError:
raise RuntimeError('cannot import pygame, make sure pygame package is installed')

Calra module

try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass

##################################################################################################

But still I am getting the error related to the egg flie. My other files are working perfectly in CARLA.

When I run the file for discrete file. I got this error.

python3 discrete_driver.py
Couldn't import Carla egg properly
pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "discrete_driver.py", line 16, in
from networks.off_policy.ddqn.agent import DQNAgent
File "/home/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/networks/off_policy/ddqn/agent.py", line 4, in
from networks.off_policy.ddqn.dueling_dqn import DuelingDQnetwork
File "/home/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/networks/off_policy/ddqn/dueling_dqn.py", line 5, in
from parameters import DQN_LEARNING_RATE, DQN_CHECKPOINT_DIR, TOWN7
ImportError: cannot import name 'TOWN7' from 'parameters' (/home/ryzen/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/parameters.py)

So I add this line in parameters.py file
TOWN7 = "Town07"

And then I got this error:

python3 discrete_driver.py
Couldn't import Carla egg properly
pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html

Exit
Traceback (most recent call last):
File "discrete_driver.py", line 212, in
runner()
File "discrete_driver.py", line 57, in runner
writer = SummaryWriter(f"runs/{run_name}/{town}")
UnboundLocalError: local variable 'run_name' referenced before assignment

How to resolve both these errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant