Open ZhuangDingyi opened 5 years ago
Hi @ZhuangDingyi, sorry to hear this! It looks to me like sumo isn't installed properly; did you install from source or from the binaries (i.e. as in https://flow.readthedocs.io/en/latest/flow_setup.html#e-easy-install-sumo-optional)? If you didn't do the latter, try it! It may resolve your problem.
Thanks @eugenevinitsky and sorry for a late update. I tried to install sumo in another way and it did fix the problem. But now I encountered other problems when running examples (SUMO GUI has successfully opened):
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
I found that tcpip problems appear frequently in SUMO. Do you have any idea about it? Thank you again for your kind response!
Hi @ZhuangDingyi, This is an error message that SUMO prints that we have not yet been able to get rid of but does not seem to actually impede any of our run scripts. Does the simulation actually run?
Hi @eugenevinitsky, Actually, the simulation just got stuck in the first place when I clicked "run" button. The error message jumped out and the terminal started retrying over and over again. I think I need to focused on the SUMO issue in the following days. If I have any updates, I will let you know. Thanks again for your kind response and merry the upcoming Christmas :P
Hi @ZhuangDingyi, oh can you post the whole error message? We should be able to help you. Merry upcoming Christmas!
Of course @eugenevinitsky ,here are the codes and results:
For my environment:
(flow) dingyi@DingyiZhuang:~/flow-project/flow/tutorials$ python -V
Python 3.5.2 :: Continuum Analytics, Inc.
(flow) dingyi@DingyiZhuang:~/flow-project/flow/tutorials$ which sumo
/home/dingyi/sumo/bin/sumo
(flow) dingyi@DingyiZhuang:~/flow-project/flow/tutorials$ sumo --version
Eclipse SUMO Version git
Build features: x86_64-pc-linux-gnu PROJ GDAL GUI
Copyright (C) 2001-2018 German Aerospace Center (DLR) and others; http://sumo.dlr.de
Eclipse SUMO Version git is part of SUMO.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License v2.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Then I run
(flow) dingyi@DingyiZhuang:~/flow-project/flow/tutorials$ python ~/flow-project/flow/examples/sumo/sugiyama.py
I got the result in terminal (no retrying this time):
Loading configuration... done.
Success.
Loading configuration... done.
Traceback (most recent call last):
File "/home/dingyi/flow-project/flow/examples/sumo/sugiyama.py", line 62, in <module>
exp = sugiyama_example()
File "/home/dingyi/flow-project/flow/examples/sumo/sugiyama.py", line 55, in sugiyama_example
env = AccelEnv(env_params, sumo_params, scenario)
File "/home/dingyi/flow-project/flow/flow/envs/loop/loop_accel.py", line 57, in __init__
super().__init__(env_params, sumo_params, scenario)
File "/home/dingyi/flow-project/flow/flow/envs/base_env.py", line 143, in __init__
self.setup_initial_state()
File "/home/dingyi/flow-project/flow/flow/envs/base_env.py", line 355, in setup_initial_state
vehicle_obs = self.traci_connection.vehicle.getSubscriptionResults()
TypeError: getSubscriptionResults() missing 1 required positional argument: 'objectID'
Of course, in the SUMO-GUI I got
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
Quitting (on error).
But it is glad that the vehicles are arranged in the loop. I might mistake some previous errors where terminal is retrying over and over again. I have update some packages last night and fixed some environment issues (maybe?) and now only this TypeError occurs. Thanks very much for your warm help and wishes:)
@ZhuangDingyi I see! It looks like your Traci version doesn't match your SUMO version. My recommendation, if you are running this in a conda env, go to the main folder and run python setup.py develop
. Then, check your .bash_rc, or .bash_profile if you are running a mac and make sure that there are no extraneous definitions defining a path to TRACI such as
PYTHONPATH="$HOME/sumo/tools:$PYTHONPATH
Again, sorry for the trouble. We are working hard to make the install process easier.
closing this issue since it's gone stale. feel free to reopen if this is still an issue
Hi, I meet the same problem when running the examples/sumo/sugiyama.py in Pycharm:
Error during start: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
Retrying in 1 seconds...
/bin/sh: 1: netconvert: not found
Error during start: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
Retrying in 1 seconds...
Error during start: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
Retrying in 1 seconds...
Error during start: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
Retrying in 1 seconds...
Error during start: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
Retrying in 1 seconds...
Error during start: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
Retrying in 1 seconds...
Traceback (most recent call last):
File "/home/runsheng/codes/flow/flow/core/kernel/scenario/traci.py", line 523, in generate_net
edges_dict, conn_dict = self._import_edges_from_net(net_params)
File "/home/runsheng/codes/flow/flow/core/kernel/scenario/traci.py", line 815, in _import_edges_from_net
tree = ElementTree.parse(net_path, parser=parser)
File "/home/runsheng/anaconda3/envs/flow/lib/python3.5/xml/etree/ElementTree.py", line 1184, in parse
tree.parse(source, parser)
File "/home/runsheng/anaconda3/envs/flow/lib/python3.5/xml/etree/ElementTree.py", line 585, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/runsheng/codes/flow/flow/core/kernel/scenario/debug/cfg/sugiyama_20190526-2030431558873843.9122386.net.xml'
But it is fine when using Terminal to run the code. I have no idea why this occurs.......
Thank you!
Hi @yurunsheng1 sorry for the late reply! My best guess is pycharm is having difficulty finding the sumo binaries, hence the error message:
/bin/sh: 1: netconvert: not found
You may want to look into this online, there may be suggestions about how to mix it.
Hi @yurunsheng1,
just had the same issue with Pycharm giving the FileNotFoundError while in the terminal everything worked fine. The problem was, as @AboudyKreidieh pointed out, that the binaries of Sumo could not be found within PyCharm.
The Sumo path was added to the bashrc file by the sumo installation script, but Pycharm does not load this, unlike the terminal. Other than expected, starting PyCharm from the console also did not help. Since I could not just append the sumo path within PyCharm as done by the export command, my solution was as follows:
To get the full path string my approach was to:
Might not be the most beautiful solution, but now it works.
I will have a try, thank you so much! @buechelmartin @eugenevinitsky @AboudyKreidieh
If you initial motivation of using Pycharm was to be able to use the debugger, you might want to know that I wasn't successful yet in using it within the environment python code. Seems like the way Ray is calling it's workers isn't supported by the Pycharm debugger, at least unless you are using the Professional version. I could not verify this finding for sure though.
Being aware that this might be a new issue, I want to ask the others about hints how they manage to use a debugger working inside the environment code?
Since someone encountering the original error messages when using Pycharm might be highly interested to know if they really want to spend (or lose?) time fixing their Pycharm project, I post it here.
Hi @AboudyKreidieh, I tried sumo-gui successfully but encountered problems with when trying the example. Can you provide any insights? Thanks
(base) hao@hao-B360-AORUS-GAMING-3-WIFI:~$ source activate flow (flow) hao@hao-B360-AORUS-GAMING-3-WIFI:~$ python examples/sumo/sugiyama.py python: can't open file 'examples/sumo/sugiyama.py': [Errno 2] No such file or directory
My log is that:
(flow) wlan-napt-002:flow xiaohongzhi$ python examples/aimsun/sugiyama.py
^CListening for connection... Traceback (most recent call last):
File "examples/aimsun/sugiyama.py", line 59, in
Created LogSyncer for /Users/xiaohongzhi/ray_results/stabilizing_the_ring/PPO_WaveAttenuationPOEnv-v0_0_2019-06-29_14-56-16_bnosnlr -> == Status == Using FIFO scheduling algorithm. Resources requested: 3/3 CPUs, 0/0 GPUs Memory usage on this node: 6.8/8.6 GB Result logdir: /Users/xiaohongzhi/ray_results/stabilizing_the_ring RUNNING trials:
2019-06-29 14:56:29,682 WARNING ppo.py:137 -- By default, observations will be normalized with MeanStdFilter Loading configuration... done. Success. Starting SUMO on port 49927 Loading configuration... done. 2019-06-29 14:56:30,931 INFO policy_evaluator.py:262 -- Creating policy evaluation worker 0 on CPU (please ignore any CUDA init errors) 2019-06-29 14:56:30.940968: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX /anaconda3/envs/flow/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:100: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " 2019-06-29 14:56:33,021 INFO multi_gpu_optimizer.py:74 -- LocalMultiGPUOptimizer devices ['/cpu:0'] Loading configuration... Loading configuration... done. done. Success. Success. Starting SUMO on port 49932 Starting SUMO on port 49933 Loading configuration... Loading configuration... done. done. 2019-06-29 14:56:50,672 INFO policy_evaluator.py:262 -- Creating policy evaluation worker 1 on CPU (please ignore any CUDA init errors) 2019-06-29 14:56:50,673 INFO policy_evaluator.py:262 -- Creating policy evaluation worker 2 on CPU (please ignore any CUDA init errors) 2019-06-29 14:56:50.674688: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX 2019-06-29 14:56:50.675984: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX /anaconda3/envs/flow/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:100: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " /anaconda3/envs/flow/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:100: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. "
Loading configuration... Loading configuration... done. done. Success. Success. Starting SUMO on port 49933 Starting SUMO on port 49932 Loading configuration... Loading configuration... done. done.
Loading configuration... done. Success. Starting SUMO on port 49932 Loading configuration... done.
Loading configuration... done. Success. Starting SUMO on port 49933 Loading configuration... done.
Loading configuration... done.
Success. Starting SUMO on port 49933 Loading configuration... done. Success. Loading configuration... done. Starting SUMO on port 49932 Loading configuration... done.
BUT, i didn't see any sumo program is running... Why, what should i did ?
^CTraceback (most recent call last):
File "/anaconda3/envs/flow/lib/python3.5/site-packages/ray/monitor.py", line 379, in
Stack (most recent call first):
File "/anaconda3/envs/flow/lib/python3.5/site-packages/ray/worker.py", line 944 in _get_next_task_from_local_scheduler
File "/anaconda3/envs/flow/lib/python3.5/site-packages/ray/worker.py", line 961 in main_loop
File "/anaconda3/envs/flow/lib/python3.5/site-packages/ray/workers/default_worker.py", line 107 in
Stack (most recent call first): File "/anaconda3/envs/flowFatal Python error: /Abortedl
ibStack (most recent call first): /python3.5/ File site-packages/ray/wor"k/earn.apcyo"nda3/envs/flo, line w2485/ in lwiabi/tp y File thon3.5/site-"p/aacnkaacgoensd/ar3a/ye/nwvosr/kfelro.wp/yl"ib/pythoWARNING: Logging before InitGoogleLogging() is written to STDERR n, line 3F0629 15:03:28.852989 1589392832 raylet_extension.cc:190] Check failed: _s.ok() [RayletClient] Failed to wait for objects.: IOError: [RayletClient] Raylet connection closed. .9445 in /site-pac_kgaegtesn/erxaty/tralslki_bf/roopmt_ilmoiczaelr_ss/crhoeldluoluetr Check failure stack trace: . p File y""/anaconda3/, line e26n in vs/flow/licbo/lpyltehcoFatal Python error: tn_Aborted3s
.a5m/pslietse
Stack (most recent call first):
-packages/r File a"y//aw File noarckoenrd.ap3y/"e, line n961v in sm/afilno_wl/oloipb"
//payntahcoonn3d.a5 File /3s/ietnev-sp/afclkoawg/elsi/br/apyy/trhlo"n/l3ai.nb5a//cosopinttdieam-3ip/zaeecrnskv/asmg/ueflslt/oirwa/ygl/piwubo/ropkpyettrih.mopinyz3"e.r5./psyi"te-pac, line k2485a in ge, line s125/ in rsatywe/apw
io File tr
"k/earnsa/cdoenfda File au3l/te_nwvosr/kfl"/anaconda3/envs/ofwl/olwe/ilbir/b.p/pypyty"htohno3n.35./5s/istiet-e, line p-107ap in acckkaaggeess//rraayy/</rmtlouldniuebl//era>ag
ye_nttrsi/aplp_oe/xpepcou.tpoyr".p, line y101" in , line 199 in _train
File "/gaenta_cnoenxdta_3a/veanivlsa/bflleo_wt/rliiabl
/ File "/payntahcoonn3d.a53/s/ite-packages/ray/tune/trainable.py", line e146n in vtsr/afilno
w/lib/python3 File .5"//saintaec-opnadcak3a/geensv/sr/afyl/otwu/nlei/bt/rpiyatlh_ornu3n.5n/site-packages/ray/rllib/agenetrs./payg"ent.py", line 259 in , line 279 in trpariocne
s File s"e/vaennatcso
nda3/envs/ File f"l/oawn/alciobn/dpay3t/heonnv3s./5f/lsoiwt/el-ipba/cpkyatgheosn/3r.a5y//sfiutnec-tpiaocnk_amgaensa/greary./ptyu"ne, line /713t in raicatlo_rr_umnentehro.dpye"xecutor
File "/, line a118n in aconda3/envss/tfelpo
w/lib/python3 File .5/site-packages/ray/wor"k/earn.apcyo"n, line d820a in 3/pernovcse/sfsl_otwa/slki
b File /"p/yatnhaocno3n.d5a/3s/ietnev-sp/afclkoawg/elsi/br/apyy/tthuonne3/.t5u/nsei.tpey-"packages/ray, line /108w in orker.py"run_experi, line m919e in n_twsa
it_for_and_p File rocess_task
File "/anaco"nedxaa3m/pelnevss//rfllloiwb//lsitba/bpiyltihzoinn3g._5t/hsei_trei-npga.cpkya"ges/ray/wor, line k140e in r.py"<mod, line u962l in em>a
in_loop
File "/anaconda3/envs/flow/lib/python3.5/site-packages/ray/workers/default_worker.py", line 107 in
This is other log when i type Control+C.
@zhouhao0605: looks like your sumo path is not in your python path and you dont call the full, correct path.
@xiaoToby : check out the tutorial about visualization. per default, sumo is not rendered since this takes too long during training. you can run the visualizer from the checkpoints later. thats all in the tutorials
Hi, I really appreciate your work. I followed the steps and was ready to run sugiyama.py but got the Error:
Error during start: Traceback (most recent call last): File "/home/dingyi/flow-project/flow/flow/scenarios/base_scenario.py", line 827, in generate_net edges_dict, conn_dict = self._import_edges_from_net() File "/home/dingyi/flow-project/flow/flow/scenarios/base_scenario.py", line 1216, in _import_edges_from_net os.path.join(self.cfg_path, self.netfn), parser=parser) File "/home/dingyi/anaconda3/envs/flow/lib/python3.5/xml/etree/ElementTree.py", line 1184, in parse tree.parse(source, parser) File "/home/dingyi/anaconda3/envs/flow/lib/python3.5/xml/etree/ElementTree.py", line 585, in parse source = open(source, "rb") FileNotFoundError: [Errno 2] No such file or directory: '/home/dingyi/flow-project/flow/flow/scenarios/debug/cfg/sugiyama_20181220-1150491545277849.601907.net.xml'
I have noticed that 2018/12/20-11:50 is exactly the time I run the command. Is there any code that request real-time net.xml files from some external sources?