Remove TF 2.0 Warning from printing - tensorflow2.0

I want to silent my code in order to delete TensorFlow:Warning from printing in the console.
I tried solutions founded on different blogs / even here.
Any permanent solution / idea to solve that ?

I don’t recommend it but you can suppress the warnings using the warning library in python
import warnings
warnings.filterwarnings("ignore")

Related

How to stop the PNG warning: iCCP: known incorrect sRGB profile printing to console?

I am trying to run some code which cannot be altered in functionality, but it would be great if I can somehow ignore the warnings or prevent them from being printed to the console, as it congests it and makes it unreadable. Thank you.
You can try tf.autograph.set_verbosity it's used to control how much info tensorflow logs as indicated in their docs for TF2.6
tf.autograph.set_verbosity(
level=0, alsologtostdout=False
)
Check also the answers here which covers solutions for multiple versions of tensorflow and python.

SonarQube: How to suppress a warning in Kotlin code

I'm using SQ 7.3-alpha1 with sonar-kotlin-plugin-1.0.1.965.jar. However, I cannot deactivate a special warning inside my Kotlin code for repositories in Spring Data where I need an "_" in a method name.
I tried both //NOSONAR and #Suppress("kotlin:S100") and #SuppressWarnings("kotlin:S100"). Any hint is appreciated.
You're not able to deactivate that issue because none of the mechanisms you're trying to use have been implemented for Kotlin.
Instead, you'll have to do this from the UI side.
Great news, https://jira.sonarsource.com/browse/SONARSLANG-373 is fixed in version 1.6 of Sonarslang. So an update to that version might improve the situation. I’ve not tested it yet, hence the cautious wording.

IntelliJ: cannot resolve smybol in "org.apache.commons.lang3.tuple.ImmutablePair"

I am working on a web visualisation for a given project (db with genes, proteins, task is to do some nice visualisation with springboot and thymeleaf). The project was provided with all files, yet I am missing some libraries (also leading to some errors in the code ofc).
When trying to import:
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
lang3 gives me a "cannot resolve symbol" error and automatically searching jars on web results in "no jars found".I found the lang3-jar manually and successfully added it to the project library. When importing:
import org.apache.commons.lang3.*;
All errors for tuple.Pair-usage are gone. Yet, usage of ImmutablePair still results in a "cannot resolve symbol" error.
Firstly, I am confused and now unsure, if my knowledge of imports is correct. I learned, if for example you import something.anything.x and something.anything.y, you could also just import something.anything.*; and x and y would be covered.
Secondly, if needed, where do I find the jars I need (I could not find them yet).
Thanks :)
So, I do not know, where this error results in, yet I do know a solution. When adding the library, select "From Maven" and search for Apache lang3 and add it. Resolves the problems.

How to silence the UserWarning from scipy.ndimage.zoom

I'm using scipy.ndimage.zoom and I get this annoying warning:
UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed.
I'm not sure what I should get from it, I started using it with SciPy 1.0.0 so I don't believe it really affects me.
I guess calling it UserWarning is a bit questionable given it's not intended for user consumption, but maybe the intended user is the developer importing the library.
I'm using multiprocessing and I get one warning per process, even more annoying.
Is there a sane way to silent it?
It was easier than I thought, leaving the question for future reference in case anyone needs this.
import warnings
warnings.filterwarnings('ignore', '.*output shape of zoom.*')
Your proposed solution did not work for me. But what does work is:
import warnings
# other nice code
with warnings.catch_warnings():
warnings.simplefilter("ignore")
x = scipy.ndimage.interpolation.zoom(...)

IntelliJ not respecting import ordering on 'Optimizing imports'

I have an import ordering setup in IntelliJ:
But when I do Ctrl + alt + O to optimize my imports, it shoves the google imports on top followed by the company imports and does not insert a blank line either. Anything I'm missing here?
Notice how the import packages are displayed:
import com.company.*.* and import com.google.*.*
vs
import java.* and import javax.*
When you specify the package name do not add .* at the end (i.e you have written com.company.*, but you should write com.company instead).
There is a bug listed in IntelliJ's IDEA's bug tracker IDEA-142468 which I believe describes this issue. It appears to particularly not work well when attempting to list static imports first. Unfortunately, I don't see much of a resolution or workaround within that ticket.
While these aren't completely satisfying, here's what I suggest:
Voting for that issue within IDEA's bug tracker system, and perhaps commenting referencing your screenshots of your configuration and how it isn't working for you, if you think doing so may help them understand the conditions of the problem.
Somehow dealing with the problem until the bug is fixed, either by seeing if it's acceptable to your team to have the static imports at the bottom (assuming that it fixes the problem), or otherwise using IDEA's default import ordering. (Which is pretty lousy suggestion, I admit, I'm just not sure what else to suggest if IntelliJ IDEA isn't working and you want to continue using it.)
If you have a support contract with Jetbrains, you could try contacting support to see if they have further suggestions, and to ensure that they know how this bug is affecting your productivity using their tools.