Code Optimization

Interesting things about software development and code optimization

Tensorflow, Flask and Multi-Threading

Hello friends,


very quick question and answer - are you trying to use your Tensorflow (Keras) prediction model from Flask? 

Here is your answer :) (You have to use Tensorflow sessions for graphs)



...

#on Flask run method

session_conf = tensorflow.ConfigProto(intra_op_parallelism_threads=1,
                          inter_op_parallelism_threads=1)

tensorflow.Session(graph=tensorflow.get_default_graph(), config=session_conf)
_graph = tensorflow.get_default_graph()

#on Flask run method

....


Thank you!


1vqHSTrq1GEoEF7QsL8dhmJfRMDVxhv2y



No suitable Android AVD system images are available - Flutter and VS Code

Hello friends,


I was trying to setup and run an android emulator for my Flutter project on Visual Studio Code IDE and got the following error:

No suitable Android AVD system images are available. You may need to install these using sdkmanager, for example: sdkmanager "system-images;android-27;google_apis_playstore;x86"

So steps to solve this issue are the following:

1. Check if there is the path under PATH System Environment Variable: C:\Users\User1\AppData\Local\Android\sdk\tools\bin

      if not then add it pointing to your ANDROID SDK TOOL BIN location

2. Run Windows Powershsll (Admin) and run the command: sdkmanager "system-images;android-27;google_apis_playstore;x86"

3. Wait until it is finished and run the Create Android Emulator in Visual Studio Code


Now everything should work and you should be able to create a new emulator :)


Enjoy!


1vqHSTrq1GEoEF7QsL8dhmJfRMDVxhv2y