question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error running sf2 example

See original GitHub issue

Hello, sorry if I’m doing something silly, but I set up a conda environment for sf2, and am trying to run the vizdoom training examples.

If I run python -m sf_examples.vizdoom_examples.train_vizdoom --env=doom_battle --train_for_env_steps=4000000000 --algo=APPO --env_frameskip=4 --use_rnn=True --num_workers=72 --num_envs_per_worker=8 --num_policies=1 --batch_size=2048 --wide_aspect_ratio=False --max_grad_norm=0.0 --experiment=doom_battle

then the program crashes with

Traceback (most recent call last):
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/alex404/temporary/retinal-rl/sample-factory/sf_examples/vizdoom_examples/train_vizdoom.py", line 4, in <module>
    from sample_factory.algo.utils.context import global_model_factory
  File "/home/alex404/temporary/retinal-rl/sample-factory/sample_factory/algo/utils/context.py", line 3, in <module>
    from sample_factory.model.model_factory import ModelFactory
  File "/home/alex404/temporary/retinal-rl/sample-factory/sample_factory/model/model_factory.py", line 3, in <module>
    from sample_factory.model.actor_critic import ActorCritic, default_make_actor_critic_func
  File "/home/alex404/temporary/retinal-rl/sample-factory/sample_factory/model/actor_critic.py", line 8, in <module>
    from sample_factory.algo.utils.action_distributions import is_continuous_action_space, sample_actions_log_probs
  File "/home/alex404/temporary/retinal-rl/sample-factory/sample_factory/algo/utils/action_distributions.py", line 3, in <module>
    import gym
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/site-packages/gym/__init__.py", line 15, in <module>
    from gym.envs import make, spec, register
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/site-packages/gym/envs/__init__.py", line 5, in <module>
    _load_env_plugins()
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/site-packages/gym/envs/registration.py", line 283, in load_env_plugins
    for plugin in metadata.entry_points(group=entry_point):
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
    return SelectableGroups.load(eps).select(**params)
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/__init__.py", line 459, in load
    ordered = sorted(eps, key=by_group)
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
    eps = itertools.chain.from_iterable(
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
    k = key(element)
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name
    return self._name_from_stem(stem) or super()._normalized_name
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/__init__.py", line 622, in _normalized_name
    return Prepared.normalize(self.name)
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/importlib/metadata/__init__.py", line 871, in normalize
    return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File "/home/alex404/.miniconda3/envs/sf2/lib/python3.10/re.py", line 209, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

Any tips for how I can get around this? Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alex404commented, Oct 14, 2022

Okay, so the problem was that I was installing sf2 from source with python setup.py build && python setup.py install rather than pip install .. Oddly enough, when I first installed the latest gym, I could execute import gym just fine, but after incorrectly installing sf2 it would cause import gym statement to throw the error, even outside of any sf2 code.

Sorry if this was a novice mistake. I’ll close the issue.

1reaction
alex404commented, Oct 14, 2022

I tried running that command but see no difference. The program doesn’t even start - it crashes immediately, so it doesn’t tax any of my resources at all (though I have a relatively beefy home computer: 64G RAM and 24G VRAM)

Read more comments on GitHub >

github_iconTop Results From Across the Web

pygame-drum example in mingus gives fluidsynth soundfont ...
I have installed the various dependencies it requires such as pygame , fluidsynth etc. I get the following when I run: python pygame-drum.py ......
Read more >
Problem with an SF2 file. - Acoustica User Forums
I have an error with Mixcraft. I bougth the E-mu Proteus 2 from Soundfontdownloads.com. When i put it into mixcraft, using DSK SF2, ......
Read more >
Soundfont is corrupt (M2MidiDec, Sonic the Fighters) #5
Enter the following commands in the command prompt: ... Drag the generated Soundfont.dll and M2MidiDec.exe into the folder containing the ROM ...
Read more >
SF2 loop problem - desperate! - KVR Audio
I've been working on a song for quite awhile now, and at the very end I introduce a pad from a soundfont that...
Read more >
Sf2 fonts failure in Logic Pro X
I imported Sf2 sound fonts into Logic Pro 10.5.1 and have been useing them for some years ... Users>Music>Audio MusicApps>Sounf font samples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found