Author Archives: Robins

visual studio Error D8016 ‘/ZI’ and ‘/Gy-‘ command-line options are incompatible

An error occurred while compiling the project with Visual Studio:

Error D8016 ‘/ZI’ and ‘/Gy-‘ command line options are incompatible TextCat E:\ Desktop \20161\ Machine learning \project\002-2266031 _2_MLKD-project2-TC \ TC\ TextCat\cl 1Solutions:
Right-click project — “properties –” C/C++ — “Debug Information Format –” Select: Program Database(/Zi)

R mac X11 library is missing: install XQuartz from xquartz.macosforge.org

Today, when I ran the fix code, the following error occurred:

> fix(Carseats)
Error in check_for_XQuartz() : 
  X11 library is missing: install XQuartz from xquartz.macosforge.org

The MAC solution is simple and can be installed with BREW:

brew cask install xquartz

Finally, reboot and let the program take effect.
reference
[1]. The ggplot2 sourcing error: X11 library is missing. https://stackoverflow.com/questions/28984243/ggplot2-sourcing-error-x11-library-is-missing

pytorch: RuntimeError CUDA error device-side assert triggered

Training network error reporting: RuntimeError: cuda runtime error (710) : Device – side assert triggered the at/pytorch aten/SRC/THC/generic/THCTensorScatterGather cu: 380
the terminate called after throwing an instance of ‘c10: : Error’
I () : CUDA Error: device-side assert triggered (insert_events at /pytorch/c10/cuda/CUDACachingAllocator.cpp:569)
Reason: The label is out of line
Method: Input

CUDA_LAUNCH_BLOCKING=1 python train.py

An error generates specific information

/pytorch/aten/src/THC/THCTensorScatterGather.cu:188: void THCudaTensor_scatterFillKernel(TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, Real, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = -1]: block: [72,0,0], thread: [32,0,0] Assertion `indexValue >= 0 && indexValue < tensor.sizes[dim]` failed.

Can be seen to be Assertion ‘indexValue & GT; = 0 & & indexValue < The predicate error is tensor. Sizes [dim], which means the label is more than zero or more than the total number and crosses the line. After debugging, I found that there was a setting that was larger than the preset total number of categories when the category was labeled. I modified this label, and the problem was solved.

Supplement to the problem of “Session’app’: Error Launching activity” when running on Android

As for the problem of “Session ‘app’ : error-Launching Activity”, there are two online solutions, but none of them can launch my own

The basic solutions are

    File-> Settings-> Build, Execution,Deployment find Instant Run and remove the pre-instant Run option from tools-& gt; Android -> Sync Project with Gradle Files

Another is that the APP seems to be uninstalled, and the icon can’t be found on the desktop of the phone, but there is still caching; Open the command line directly

adb shell pm uninstall <YourAppPackageName>

Use the command to unload residual applications.


The 2019-10-28 supplement
The command line mentioned above still has some problems in the case of multiple users in the system, which may lead to unclean uninstall, too low version number or inconsistent signature, resulting in the new APK can’t be installed, and can’t be installed when using Android Studio to directly run. At this point, we can adjust the version number to a large number, and then repackage, with adb install XXX to cover the installation; Install successfully, then manually uninstall, then go to run is OK. More operational references

adb shell 
pm --help

Android Studio Error: Some file crunching failed, see logs for details

Error description:
Error:Some file crunching failed, see logs for details
Recently, a lot of readers have asked me why I still report an error after adding in according to my method. So let me add a little bit here.
Note ⚠ ️ : this is a kind of problem! So if you read the error log for Gradle, you can read the error log for Gradle. The specific methods are as follows:
Click the Gradle Console in the lower right corner. View gradle detail log:

Reasons for the problem 1:
The image in the resource file is not a PNG file. (As shown in the error report below)

Cause 2:
No margins are set for figure.9.

 

Log Log 1:
AAPT: libpng error: Not a PNG file
Error: Some file crunching failed, see logs for details
:app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:app:mergeDebugResources’.
> Error: Some file crunching failed, see logs for details

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

BUILD FAILED
Solutions for Reason 1:
In the build.gradle file of the project app, add in the Android TAB:

aaptOptions {
        cruncherEnabled = false
        useNewCruncher = false
}


Solutions for Reason 2:

We looked at the log and found that there is no margin. What is margin?Let’s look at the following two pictures

Boundless space (with no black edges)

There are margins and there are black edges all around.

 

So how do you set it up?Very simple:

Click the white edge around, the position of the click will be black, left or right or drag up and down to make the black edge change, so as to achieve the size of the set margin.

Error may not have more than the above two kinds of log, if you encounter other reasons, welcome everyone harassment!!

Error running app: Default Activity Not Found



click on the run button and make a mistake

this is a mistake that many Android developers should have encountered, and the solution is not the same. But my solution might be a little odd, and it might help you. After this problem occurred, I tried the following solution.
First, check whether the launch page in Androidmanfest.xml is configured
This is beside the point because mine is already configured
Second, set the Launch Options to Nothing in Run/Debug Configuarations
If there is no problem with plan 1, open Run/Debug Configuarations

and select Nothing — > The Apply – & gt;

this time run without error, and successfully installed into the phone, but… I didn’t launch my App after it was installed successfully. How could I launch it for you when everything was configured as Nothing?Obviously, it does not meet my requirements (when the project is very urgent, the result of this project has been very good, so we can give priority to the completion of the project and solve this problem later).
Scenario 3: Reset Android Studio
Delete.androidStudio4.0 from the directory “C:\Users\ user name” (maybe yours is another version), restart AndroidStudio and wait for the miracle, mine is still the same ghost, not solved.
Plan 4: Reinstall Android Studio
Also still be that ghost kind, fail to solve. Is it a project problem?But my colleague’s work is going really well. Finally, if you’ve reached this point, see if you can solve your problem, which is how I solved it. If not, please add plan 6 in the comments section, I am too weak.

Create a new Activity and set it to Launch Activity


. Then select the Launcher Activity — > Finish, wait for Gradle synchronous

then AndroidManfest files in the start page changed back into before start page

Module build failed Error Plugin/Preset files are not allowed to export objects, only functions (How to Fix)

As a way to make a project of nuxt, this exception occurred. Module build failed: Error: Plugin/ prefiles are not allowed to export objects, only functions : make of the following figure:

Ii. Problem Analysis and Solution: Babel version conflict, Babel dependency package is not compatible, package.json dependency package contains both Babel 7.0 version and Babel 6.0 version, the two versions are obviously incompatible, We can upgrade to Babel 7.0 version, through NPM install [email protected] command all upgrade to Babel 7.0 version, so the conflict problem of the versions can be solved.

Win32 Disk Imager Error 5: Access is Denied solution

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ An error when you are trying to write data to handle in Win32, error: An error occurred when you need to write data to handle
The solution: Format the SD memory card with THE SD Memory Card Formatter and then write the image file to the Win32 tool
Specific steps:
A, download SD memory card formatter software
the official download url: https://www.sdcard.org/downloads/formatter_4/
pay attention to choose to suit your operating system software
2, install the SD memory card formatter and open the configuration
to select the disk where your SD card is located (usually when you insert the card)
to select the Overwrite format (this is very important!)
Volume label
Volume label


click “Format” to start formatting, it usually takes 10 minutes
formatting is finished, you will find that your disk is completely empty, there are no files
3. Open Win32 again and write the image file to the disk where the SD card is located. No error will occur (click Yes to continue writing)