Questions tagged [absl-py]

Abseil consists of source code repositories for C++ and Python. abseil-py is a collection of Python library code for building Python applications. The code is collected from Google's own Python code base, and has been extensively tested and used in production.

14 questions
38
votes
12 answers

No module named 'absl' error when I import tensorflow

I have anaconda installed on my Win 7 machine with a GTX1070. I have been trying to install tensorflow gpu version for the past hour with no luck. I followed the tutorials on the tensorflow website to no success. They ask for you to install CUDA 8.0…
Ozymandias
  • 839
  • 1
  • 8
  • 13
9
votes
1 answer

Using Abseil vs. Directly calling main()?

I've been using the vanilla def main(): # Do stuff if __name__ == '__main__': main() but recently saw people doing from absl import app def main(_): # Do things if __name__ == '__main__': app.run(main) Abseil provides…
Sibbs Gambling
  • 19,274
  • 42
  • 103
  • 174
2
votes
3 answers

Getting error when running app on iOS simulator in Flutter after installing cloud_firestore package

I have tried even pod update Firebase/Firestore still getting below error when running on iOS simulator after installing cloud_firestore package. Even I have tried to delete Podfile.lock many times and flutter clean then flutter run. Note: Flutter…
1
vote
1 answer

bazel run :testing_example returns ModuleNotFoundError: No module named 'absl.testing'

I'm studying Abseil and Bazel, doing some code regarding Unit Tests Basics I got a problem regarding the absltest module: testing_example.py: from absl import app from absl import flags from absl.testing import absltest FLAGS = flags.FLAGS class…
Felipe Maion
  • 336
  • 1
  • 12
1
vote
1 answer

How to mark a flag as required only if another flag is set in absl-py?

I have two flags f1 and f2, f1 is a boolean flag. I want to mark f2 as required whenever f1 is set to True. Is this possible with absl-py?
Priyatham
  • 2,821
  • 1
  • 19
  • 33
1
vote
3 answers

Why absl flags returns True even when I assign False?

Here is the code. I tried to give this parameter 'False' value by using python file.py --add_depth_loss False but it still print "True".... Why is that? from absl import flags, app FLAGS = flags.FLAGS flags.DEFINE_boolean('add_depth_loss', None,…
dexter2406
  • 451
  • 4
  • 14
1
vote
2 answers

How to redirect abseil logging messages to stout instead of stderr?

I am using python 3.7.6. and abseil module for logging messages with absl-py 0.9.0. I am using this piece of code for my tests. from absl import logging from absl import app def main(argv): #logging.set_stderrthreshold(logging.ERROR) …
Dr. Fabien Tarrade
  • 1,556
  • 6
  • 23
  • 49
1
vote
1 answer

Python absl logging without timestamp module name

I wanted to know if its possible to log only the msg string in absl python without timestamp and module name. Example I0108 23:40:57.153055 140614090106688 extractor.py:79] processing file: dfcsdf I0108 23:40:57.162382 140614090106688…
user6863891
0
votes
0 answers

Error during installation of absl-py version 0.8.1

The command pip install absl-py==0.8.1 generates the following error: Collecting absl-py==0.8.1 Using cached absl-py-0.8.1.tar.gz (103 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error:…
Oblomov
  • 8,953
  • 22
  • 60
  • 106
0
votes
1 answer

How does function `flags.DEFINE_boolean` works?

I'm confused about the function flags.DEFINE_boolean when I'm using python's absl module. Below is my code, when I set the parameter default to True, I can no longer dynamically modify is_student to False via the command line. from absl import app,…
0
votes
0 answers

Two absl instances interferring with each others flags

I am building on an existing program, which uses absl to parse its flags. To be more concrete, I have to separate applications, which run standalone. Both of them have the same base structure: from absl import app from absl import flags FLAGS =…
wittn
  • 298
  • 5
  • 16
0
votes
0 answers

absl-py save and ignore unrecongized flags

Sometimes I have to pass flags to the python script such as --local_rank in addition to the prespecified ones in absl-py. Is there a way to - ignore unspecified flags save pre- and un-specified flags in json as dictionary
Simon
  • 703
  • 2
  • 8
  • 19
0
votes
1 answer

Could not fetch URL https://pypi.org/simple/absl-py/: when creating condas environment from file

I am trying to create an anacondas environment from a yml file I have, I have installed anacondas, have added C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\bin C:\ProgramData\Anaconda3\Scripts C:\ProgramData\Anaconda3\Library\bin All to my…
Makori SM
  • 81
  • 5
0
votes
0 answers

How to define action='store_true' in absl

I am migrating code from argparse to absl (The python version is 3.6). The code using argparse has the following parser.add_argument('--flip_left_right', default=False, help="flip", action='store_true') Using absl, I can define the flag with…
J S
  • 21
  • 4