Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

E NameError: name 'FROZEN_SYM_BD' is not defined #20

Open
dbl001 opened this issue Jan 13, 2023 · 5 comments
Open

E NameError: name 'FROZEN_SYM_BD' is not defined #20

dbl001 opened this issue Jan 13, 2023 · 5 comments

Comments

@dbl001
Copy link

dbl001 commented Jan 13, 2023

I am on MacOS 13.1 with an Anaconda virtual environmen: decision-transformer-gym

Where is FROZEN_SYM_BD defined?

E.g. - $vi +5 conf/conf_cfgs.py

MetaCfg = FROZEN_SYM_BD['fairdiplomacy.MetaCfg']
@c-flaherty
Copy link
Contributor

Quick note: Since you mentioned MacOS, my guess is you don't have an NVIDIA GPU and hence no CUDA, which is required for this repo. We're using Ubuntu 20.04.4 LTS, so I suggest moving to cloud (e.g. v100s or p100s on AWS) if you want to play around with this repo.

@dbl001
Copy link
Author

dbl001 commented Jan 19, 2023 via email

@c-flaherty
Copy link
Contributor

What's MPS?

@dbl001
Copy link
Author

dbl001 commented Jan 19, 2023 via email

@lightvector
Copy link

FROZEN_SYM_BD is a global defined in the conf/*_pb2.py files that is produced by the hacky protobuf patching system that runs on top of the protobuf compilter that should get run when you make. It's some global dictionary that the autogenerated protobuf python code puts stuff into.

Part of the output from grep FROZEN_SYM conf/conf_pb2.py -C 10 | less:

  _PLAYWEBDIPTASK._serialized_start=13325
  _PLAYWEBDIPTASK._serialized_end=14145
  _COMPUTEXPOWERSTATISTICSTASK._serialized_start=14148
  _COMPUTEXPOWERSTATISTICSTASK._serialized_end=14374
  _PROFILEMODELTASK._serialized_start=14377
  _PROFILEMODELTASK._serialized_end=14553
  _METACFG._serialized_start=14556
  _METACFG._serialized_end=15382
# @@protoc_insertion_point(module_scope)

if 'FROZEN_SYM_BD' not in globals():
   globals()['FROZEN_SYM_BD'] = {}
class _FrozenConf:
    heyhi_patched = True

    @classmethod
    @abc.abstractmethod
    def get_proto_class(cls) -> type:
        pass

    def __init__(self, *args, **kwargs):
        assert not args or not kwargs, "Either (msg, fields) or **kwargs"

Relevant code here:
https://github.com/facebookresearch/diplomacy_cicero/blob/main/heyhi/bin/patch_protos.py

which gets run as part of this command:
https://github.com/facebookresearch/diplomacy_cicero/blob/main/Makefile#L23

and which hacks the compiled protobuf files produced by protobuf to extend the functionality of the python protobuf objects (this is why the readme recommends a particular version conda install --yes go protobuf=3.19.1) and to define "frozen" i.e. immutable versions of them as well.

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

3 participants