Skip to content

UnboundLocalError: local variable 'eval_manager' referenced before assignment #242

Description

@kunukkkk

I'm sorry to ask this question again. I checked other answers to this question before, but they still can't help me solve it. The carla I used was 0.9.12, and the commands I executed were “python3 opencda.py -t single_town06_carla -v 0.9.12 --apply_ml” and “python3 opencda.py -t single_2lanefree _carla -v 0.9.12 --apply_ml”. After the execution, there will be the problem of local variable' eval _ manager' referenced before assignment. I think the previous solution was to reduce the versions of pip and open3d. I tried the same method and it didn't work. Looking forward to your answer, thank you.

The detailed error reporting information is as follows:

OpenCDA Version: 0.1.3
Traceback (most recent call last):
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 1350, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/http/client.py", line 1277, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/http/client.py", line 1323, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/http/client.py", line 1272, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/http/client.py", line 1032, in _send_output
self.send(msg)
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/http/client.py", line 972, in send
self.connect()
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/http/client.py", line 1447, in connect
server_hostname=server_hostname)
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/ssl.py", line 423, in wrap_socket
session=session
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/ssl.py", line 870, in _create
self.do_handshake()
File "/data1/users_dir/huankun/anaconda3/envs/opencda/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/notebooks/new_carla/OpenCDA-main/opencda/scenario_testing/single_town06_carla.py", line 19, in run_scenario
cav_world = CavWorld(opt.apply_ml)
File "/notebooks/new_carla/OpenCDA-main/opencda/core/common/cav_world.py", line 54, in init
self.ml_manager = ml_manager()
File "/notebooks/new_carla/OpenCDA-main/opencda/customize/ml_libs/ml_manager.py", line 29, in init
self.object_detector = torch.hub.load('ultralytics/yolov5', 'yolov5m')
File "/anaconda3/envs/opencda/lib/python3.7/site-packages/torch/hub.py", line 540, in load
verbose=verbose, skip_validation=skip_validation)
File "/anaconda3/envs/opencda/lib/python3.7/site-packages/torch/hub.py", line 180, in _get_cache_or_reload
repo_owner, repo_name, ref = _parse_repo_info(github)
File "/anaconda3/envs/opencda/lib/python3.7/site-packages/torch/hub.py", line 134, in _parse_repo_info
with urlopen(f"https://github.com/{repo_owner}/{repo_name}/tree/main/"):
File "/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 1393, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/anaconda3/envs/opencda/lib/python3.7/urllib/request.py", line 1352, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "opencda.py", line 75, in
main()
File "opencda.py", line 70, in main
scenario_runner(opt, scene_dict)
File "/notebooks/new_carla/OpenCDA-main/opencda/scenario_testing/single_town06_carla.py", line 64, in run_scenario
eval_manager.evaluate()
UnboundLocalError: local variable 'eval_manager' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions