facebookresearch / audiocraft

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.
MIT License
20.7k stars 2.11k forks source link

Unable to run the example code from musicgen fine tune in Colab #340

Open dhuang329 opened 11 months ago

dhuang329 commented 11 months ago

Hi, I am very new to deep learning and want to run the example code first. After running this command: !python3 -m pip install -U git+https://github.com/facebookresearch/audiocraft#egg=audiocraft I then run the dora run command. However, I encountered the following error:

Screenshot 2023-10-31 at 12 09 02 AM

What did I do wrong? Also, what should I do to apply LoRa to fine tune musicgen with my own dataset?

dhuang329 commented 11 months ago

After I run %cd /content/src/audiocraft/ the fatal error disappeared, but another long error message came up: WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.1.0+cu121 with CUDA 1201 (you have 2.1.0+cu118) Python 3.10.13 (you have 3.10.12) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details 2023-10-31 04:46:00.182805: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2023-10-31 04:46:00.182875: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2023-10-31 04:46:00.182924: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2023-10-31 04:46:00.192581: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-10-31 04:46:01.938557: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT Traceback (most recent call last): File "/usr/local/bin/dora", line 8, in sys.exit(main()) File "/usr/local/lib/python3.10/dist-packages/dora/main.py", line 158, in main main = get_main(args.main_module, args.package) File "/usr/local/lib/python3.10/dist-packages/dora/_utils.py", line 48, in get_main module = import_or_fatal(module_name) File "/usr/local/lib/python3.10/dist-packages/dora/utils.py", line 77, in import_or_fatal return importlib.import_module(module_name) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/content/src/audiocraft/audiocraft/train.py", line 131, in def main(cfg): File "/usr/local/lib/python3.10/dist-packages/dora/hydra.py", line 308, in _decorator return HydraMain(main, config_name=config_name, config_path=config_path, File "/usr/local/lib/python3.10/dist-packages/dora/hydra.py", line 163, in init dora = self._get_dora() File "/usr/local/lib/python3.10/dist-packages/dora/hydra.py", line 173, in _get_dora update_from_hydra(dora, self._base_cfg.dora) File "/usr/local/lib/python3.10/dist-packages/dora/conf.py", line 35, in update_from_hydra dct = OmegaConf.to_container(cfg, resolve=True) File "/usr/local/lib/python3.10/dist-packages/omegaconf/omegaconf.py", line 573, in to_container return BaseContainer._to_content( File "/usr/local/lib/python3.10/dist-packages/omegaconf/basecontainer.py", line 292, in _to_content value = get_node_value(key) File "/usr/local/lib/python3.10/dist-packages/omegaconf/basecontainer.py", line 244, in get_node_value conf._format_and_raise(key=key, value=None, cause=e) File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 231, in _format_and_raise format_and_raise( File "/usr/local/lib/python3.10/dist-packages/omegaconf/_utils.py", line 899, in format_and_raise _raise(ex, cause) File "/usr/local/lib/python3.10/dist-packages/omegaconf/_utils.py", line 797, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace File "/usr/local/lib/python3.10/dist-packages/omegaconf/basecontainer.py", line 242, in get_node_value node = node._dereference_node() File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 246, in _dereference_node node = self._dereference_node_impl(throw_on_resolution_failure=True) File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 277, in _dereference_node_impl return parent._resolve_interpolation_from_parse_tree( File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 584, in _resolve_interpolation_from_parse_tree resolved = self.resolve_parse_tree( File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 769, in resolve_parse_tree raise InterpolationResolutionError( File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 764, in resolve_parse_tree return visitor.visit(parse_tree) File "/usr/local/lib/python3.10/dist-packages/antlr4/tree/Tree.py", line 34, in visit return tree.accept(self) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar/gen/OmegaConfGrammarParser.py", line 206, in accept return visitor.visitConfigValue(self) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py", line 101, in visitConfigValue return self.visit(ctx.getChild(0)) File "/usr/local/lib/python3.10/dist-packages/antlr4/tree/Tree.py", line 34, in visit return tree.accept(self) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar/gen/OmegaConfGrammarParser.py", line 342, in accept return visitor.visitText(self) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py", line 301, in visitText return self._unescape(list(ctx.getChildren())) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py", line 389, in _unescape text = str(self.visitInterpolation(node)) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py", line 125, in visitInterpolation return self.visit(ctx.getChild(0)) File "/usr/local/lib/python3.10/dist-packages/antlr4/tree/Tree.py", line 34, in visit return tree.accept(self) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar/gen/OmegaConfGrammarParser.py", line 1041, in accept return visitor.visitInterpolationResolver(self) File "/usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py", line 179, in visitInterpolationResolver return self.resolver_interpolation_callback( File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 750, in resolver_interpolation_callback return self._evaluate_custom_resolver( File "/usr/local/lib/python3.10/dist-packages/omegaconf/base.py", line 694, in _evaluate_custom_resolver return resolver( File "/usr/local/lib/python3.10/dist-packages/omegaconf/omegaconf.py", line 445, in resolver_wrapper ret = resolver(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/omegaconf/resolvers/oc/init.py", line 38, in env raise KeyError(f"Environment variable '{key}' not found") omegaconf.errors.InterpolationResolutionError: KeyError raised while resolving interpolation: "Environment variable 'USER' not found" full_key: dora.dir object_type=dict

672s commented 7 months ago

I got exactly the same error. Did you solve it?

zeke-john commented 5 months ago

@672s @dhuang329 I am current having the same error. Any updates??

nasko25 commented 2 weeks ago

I solved it by setting a USER environment variable before the dora command like so:

USER=root dora run <...>