Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

What does VizDoom path mean? #4

Open
huiwenzhang opened this issue May 3, 2017 · 7 comments
Open

What does VizDoom path mean? #4

huiwenzhang opened this issue May 3, 2017 · 7 comments

Comments

@huiwenzhang
Copy link

Hi,
I installed all the dependent modules as required, including VizDoom, and import vizdoom works fine under test. To reproduce your experiments, the VizDoom path variable should be changed. However, I didn't figure out what does path stands for? Can anyone one give me an answer.
Thanks

@dosovits
Copy link
Contributor

dosovits commented May 3, 2017

Hi,

This variable should point to the root path of the ViZDoom toolbox. I think it may have to be relative path (relative to where doom_simulator.py is), but maybe absolute would also work, depending on your ViZDoom version.

Alexey

@huiwenzhang
Copy link
Author

@dosovits Hi, thanks for your explanation. I guess you're right. However, the source code is really confusing. According to the source code, there should have subdirectories "bin/python, bin/vizdoom, bin/.." under vizdoom path. But as I import vizdoom, and print the 'vizdoom.file', I got '/home/heaven/python-proj/virtual-env/active-imitation/lib/python3.5/site-packages/vizdoom'. It's very different form your situation. So I made some changes about the source code and It works fine. I didn't go through the code deeply, But as the result shows, I should be right.

@dosovits
Copy link
Contributor

dosovits commented May 4, 2017

@HEAVEN91 Thanks for the response. It seems, the difference is that you installed vizdoom with something like pip, while I compiled myself from source. Maybe the file structure is different in these two cases. Unfortunately I do not have time to go into this myself right now, but generally it sounds like a good idea to modify the code so that it works in both cases.

Alexey

@huiwenzhang
Copy link
Author

@dosovits Yes, you're right. I do installed the VizDoom toolbox with pip.

@GoingMyWay
Copy link

GoingMyWay commented May 24, 2017

@HEAVEN91 , how to set the path?

OS is MacOS, and it prints the following error:

$ cd DirectFuturePrediction/examples/D3_battle
$ python3 run_exp.py show
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/vizdoom/__init__.py
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
Requested resolution not supported: <class 'AttributeError'> . Setting to 160x120 and resizing
2017-05-24 15:04:41.794873: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-24 15:04:41.794896: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-24 15:04:41.794903: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-05-24 15:04:41.794908: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-24 15:04:41.794913: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
/Users/qiuwei/Library/Python/3.6/lib/python/site-packages/tensorflow/python/ops/gradients_impl.py:93: 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. "
 [*] Reading checkpoints...
== Testing the policy ==
Traceback (most recent call last):
  File "run_exp.py", line 129, in <module>
    main(sys.argv[1:])
  File "run_exp.py", line 125, in main
    experiment.run(main_args[0])
  File "../../DFP/multi_experiment.py", line 119, in run
    self.ag.test_policy(self.multi_simulator, self.train_experience, self.test_objective_coeffs, self.test_policy_num_steps, random_prob = self.test_random_prob, write_summary=False, write_predictions=True)
  File "../../DFP/agent.py", line 373, in test_policy
    experience.add_n_steps_with_actor(simulator, num_steps, actor, verbose=True, write_predictions=write_predictions, write_logs=True, global_step=self.curr_step*self.batch_size)
  File "../../DFP/multi_experience_memory.py", line 153, in add_n_steps_with_actor
    self.add_step(multi_simulator, curr_act.tolist(), actor.objectives_to_write(), actor.curr_predictions)
  File "../../DFP/multi_experience_memory.py", line 106, in add_step
    self.add(*(multi_simulator.step(acts) +  (acts,objs,preds)))
  File "../../DFP/multi_doom_simulator.py", line 45, in step
    img, meas, rwrd, term = sim.step(act)
  File "../../DFP/doom_simulator.py", line 102, in step
    self.init_game()
  File "../../DFP/doom_simulator.py", line 82, in init_game
    self._game.init()
vizdoom.vizdoom.FileDoesNotExistException: File "../../../../toolboxes/ViZDoom_2017_03_31/bin/vizdoom" does not exist.

To address the file-does-not-exist issue, I created a directory and copied the bin directory from the source code which I rebuilt.

$ mkdir ../../../../toolboxes/ViZDoom_2017_03_31/bin
$ ls -l   # show the contents of bin directory after building the source code of ViZdoom.
total 59048
-rw-r--r--  1 qiuwei  staff  29182140 Dec 23  2015 freedoom2.wad
-rwxr-xr-x  1 qiuwei  staff    405904 May  8 22:13 libvizdoom.dylib
drwxr-xr-x  4 qiuwei  staff       136 May  8 22:13 python3
lrwxr-xr-x  1 qiuwei  staff        48 May  8 22:13 vizdoom -> /Users/qiuwei/AI/ViZDoom/src/vizdoom/src/vizdoom
drwxr-xr-x  3 qiuwei  staff       102 May  8 22:08 vizdoom.app
-rw-r--r--  1 qiuwei  staff    630827 May  8 22:13 vizdoom.pk3

Copy files to ../../../../toolboxes/ViZDoom_2017_03_31/bin and make a symbolic of vizdoom

@GoingMyWay
Copy link

GoingMyWay commented May 24, 2017

Maybe there is something wrong in my previous steps, I deleted the symbolic link and copied vizdoom from bin/python3/pip_package/vizdoom

So, here to tackle the vizdoom.vizdoom.FileDoesNotExistException: File "../../../../toolboxes/ViZDoom_2017_03_31/bin/vizdoom" does not exist. issue, follow the following steps

  • Make sure you have successfully build the ViZdoom from source
  • Mkdir
$ cd DirectFuturePrediction/examples/D3_battle
$ mkdir ../../../../toolboxes/ViZDoom_2017_03_31/bin
  • Copy files in bin directory from the built ViZdoom code
  • Copy vizdoom file to ../../../../toolboxes/ViZDoom_2017_03_31/bin, the vizdoom file is in /path/to/vizdoom/bin/python3/pip_package

Also, you can adjust ViZDoom path in doom_simulator.py
Hope it helps!

@samuro95
Copy link

Did you manage to make it work on MacOS ?

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

No branches or pull requests

4 participants