Comments (3)
Do you have a full traceback and error message? It should contain the two places where this flag is defined.
I'm not familiar with spyder, does it re-import your modules twice during your debugging process? absl.flags
should be handling the "module being re-imported / re-loaded" case here:
abseil-py/absl/flags/_flagvalues.py
Lines 423 to 428 in 58ead8c
from abseil-py.
This is the error it produces:
absl.flags._exceptions.DuplicateFlagError: The flag 'workdir' is defined twice. First from c:\users\dell g7 user 2\documents\projects\vision_transformer\vision_transformer\vit_jax\main.py, Second from c:\users\dell g7 user 2\documents\projects\vision_transformer\vision_transformer\vit_jax\main.py. Description from first occurrence: Directory to store logs and model data.
The code that runs:
FLAGS = flags.FLAGS
_WORKDIR = flags.DEFINE_string('workdir', 'workdir','Directory to store logs and model data.')
This is the code that came with the script. It is supposed to be a python module and was not meant to be run iteratively, hence the odd behavior.
from abseil-py.
Looks like when you rerun the module in spyder, it will re-execute the module a second time without actually starting a new process.
From absl.flags
's perspective, this is really working as intended: it defines the --workdir
flag in the global FLAGS
object the first time your run the script. Then in the second run, it tries to define the flag again in FLAGS
with the same module object.
I think you'll get better answers from spyder users/community.
from abseil-py.
Related Issues (20)
- Logging disappeared after switching from app.run(main) to main() HOT 5
- argparse_flags.ArgumentParser does not accept --flagfile if there are no flags HOT 3
- Accessing C++ flags from Python HOT 1
- Use Default Loggers/Handlers with Abseil `app.run` HOT 4
- DEFINE_enum supports Enum? HOT 3
- Fails to install absl-py in PY3.11 in windows10 HOT 3
- absltest.main() dosen't work on Windows, but work on MacOs HOT 2
- AbslTest.assertSameStructure() doesn't work with TestCase.addTypeEqualityFunc()
- Absl installation problem HOT 6
- typo
- If I use use_absl_log_file, I will get two files with the same content, what can I do to generate just one file? HOT 2
- Permission issue for 1.4.0 HOT 1
- Test cases should be parameterizable based on command-line flags (and other things) HOT 1
- Error during installation of version HOT 1
- Unintended behaviour in absltest.py
- absl.logging possibly causing PyCharm debugger to crash during tests HOT 1
- Add MODULE.bazel HOT 9
- No pyi files from pip package
- Absl Installation on Virtual Environment HOT 1
- class ArgumentParser(Generic[_T], metaclass=_ArgumentParserCache): TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abseil-py.