Tag Archives: 1024 programmer section

PyCharm Error: RuntimeError: CUDA out of memory [How to Solve]

Error:
RuntimeError: CUDA out of memory.Tried to allocate 48.00 MiB (GPU 0; 2.00 GiB total capacity; 1001.96 MiB already allocated; 36.14 MiB free; 1.12 GiB reserved in total by PyTorch)

Solution:

C:\Users\hp>nvidia-smi
'nvidia-smi' is not an internal or external command, nor a runnable program
or batch file.

C:\Users\hp>cd C:\Program Files\NVIDIA Corporation\NVSMI

C:\Program Files\NVIDIA Corporation\NVSMI>nvidia-smi
Sun Oct 24 19:31:25 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 462.80       Driver Version: 462.80       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050   WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   42C    P8    N/A/ N/A |     70MiB/ 2048MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      4248    C+G   ...bbwe\Microsoft.Photos.exe    N/A      |
+-----------------------------------------------------------------------------+

C:\Program Files\NVIDIA Corporation\NVSMI>taskkill -PID 4248 -F
成功: 已终止 PID 为 4248 的进程。

C:\Program Files\NVIDIA Corporation\NVSMI>nvidia-smi
Sun Oct 24 19:38:39 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 462.80       Driver Version: 462.80       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050   WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P8    N/A/ N/A |     70MiB/ 2048MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

C:\Program Files\NVIDIA Corporation\NVSMI>

[Solved] Vue project deploys nginx to refresh the interface 404 Error

1. Phenomenon

2. Solution

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 4096;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       8071;
        server_name  101.42.104.247;
        location/{
            root /home/intelligent_evaluation_of_rock_burst/development_project/dist;
            index index.html index.htm;
            try_files $uri $uri/ /index.html; //Add this line
        }
        #Dynamic requests
        location /api{
          include uwsgi_params;
          uwsgi_pass 127.0.0.1:5000;
        }

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

Nginx – s reload nginx

Nginx – t test whether nginx is normal

[Solved] Redis Cache Error: org.springframework.data.redis.serializer.SerializationException: Could not read JSON..

Problem description


Using redis to cache data, it can be successfully saved to redis

The serialization format of the value used is: genericjackson2jsonredisserializer , but the error is obtained from the cache for the second time


Key error message, suggesting no constructor
org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Cannot construct instance of `io.renren.common.utils.PageUtils` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

Problem-solving:

The first method directly changes the serialization of value to string type. The second method adds an empty parameter structure

The second method is adopted. The disadvantage of the first method is that Chinese information may be escaped

[Solved] Vue Error: Uncaught TypeError: Vue.createApp is not a function

Project scenario:

Today, in the process of reviewing the basis of Vue, I tried to introduce and use Vue with traditional HTML and native memory, and then found that I really pulled it. The memory is not only vague, but also confused. Vue2 mixed with vue3 is there! Next, let’s see how to report the error.

Problem Description:

The HTML structure is as follows:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
  </head>
  <body>
    <div id="app"></div>
  </body>
  <script>
    const app = Vue.createApp({
        data() {
            return {
                message: '666'
            }
        },
        template: "<h2>{{message}}</h2>"
    })
    app.mount("#app")
  </script>
</html>

Good guy, 666 didn’t render. Just click and report me the error
Uncaught TypeError: Vue.createApp is not a function。
I’m still wondering. I think it’s ok if createapp creates a Vue application and mount it to the node?Why, vue.createapp is not available yet

Cause analysis:

Later, I read the document and found that I had mixed up vue.createapp and mount, which are the writing methods of vue3, but I introduced vue2
it is clearly written on the official website. Vue2 uses new and is an EL mount node
vue2 is written as follows:

 var app = new Vue({
   el: '#app',
   data: {
     message: '666',
   },
   template: '<h2>{{message}}</h2>',
});

The following is the way vue3 is written

 const app = Vue.createApp({
     data() {
         return {
             message: '666'
         }
     },
     template: "<h2>{{message}}</h2>"
 })
 app.mount("#app")

An error is reported when executing MVN. The diamond operator is not supported in source-1.5

Specify the version of Maven and the JDK version used by Maven

Modify in pom.xml

<project xmlns="...">
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    ...
</project>

How to Solve cocos2dx msb3073 Error

Solve cocos2dx 3.17 error msb3073:: vcend “has exited, the code is 9009 and an error is reported

For example, if the dill function appears, and the msb3073 code is 9009 or 4, the error
and the libcurl file cannot be connected appear at the same time, or the error
msb3073 code is 9009, the command xcopy/Y/Q and if not exist will be prompted (your project path)
the solution is as follows (try one by one) :
1. Change the Cocos environment path from Chinese to English or the project path from Chinese to all citations
2. Confirm that your environment variables are set correctly and that pyhton and cocos environment variables are
3. If none of the above methods can be solved, your problem should be the same as me. If you reinstall the system or newly install the system, in the path of the environment variable Adding C:\windows\system32 should be able to solve the problem, because you may have deleted the environment variable path by mistake, resulting in file replication failure. Add the following files in sequence:% systemroot%\system32;% systemroot%;% systemroot%\system32\WBEM;% systemroot%\system32\windowspowershell\v1.0;
as shown in the figure

Hadoop reports an error. Cannot access scala.serializable and python MapReduce reports an error

Record the problems encountered when doing school Hadoop homework. The homework is more basic, that is, calling Hadoop through makefile to execute the MapReduce program written in advance

Error 1

An error occurred in the Hadoop wordcount code

java: cannot access scala.Serializable class file for scala.Serializable not found

An error is reported

Solution:
through this Q & A on stack overflow, I guess that the scala version is incompatible with the Hadoop version, so rollback to 2.7 will solve the problem

Error report 2

Attempting to run Python on Hadoop. But an error is reported. The error information is not detailed:
insert a picture description here

solution:
add the following at the beginning of the source code:

#!/usr/bin/env python
# -*-coding:utf-8 -*

(the problem with the coding format is really that I don’t know how to debug it.)

Common errors reported by Eureka in spring cloud

1.Consider the following:
     If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
     If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

The reason for this is that the service provider starts earlier than Eureka, or Eureka service may not start, and then start the service provider after Eureka starts.

2.No instances found of configserver (config-server)

The annotation @ enablediscoveryclient may be missing from the startup class

  3.Cannot execute request on any known server

This error is due to the missing annotation @ enableeurekaserver in the Eureka startup class

 

 

 

How to Solve Vscode save Vue file eslint error

Problem background

When using vscode to automatically save, it is found that there is a problem with each save format.

Solution:

There are only a few storage formats

The saving format of vscode itself uses the saving format configured by eslint
so after analysis, the problem is clear at a glance.

After investigation,
it was originally set in vscode settings.json

"editor.formatOnSave": true,

Also set

"editor.codeActionsOnSave": {
   "source.fixAll.eslint": true
},

In this way, the first save takes effect, but the second save uses other configurations, resulting in inconsistency between the two
handle

"editor.formatOnSave": true,

Just delete this configuration. When saving, you can only format it according to the eslint configuration.

git_error:unable to auto-detect email address [How to Solve]

the reason:
maybe I set the environment variable :home
the variable may impact the .gitconfig
this lead to me set the gitconfig failed(,and I could not do any commit!)
so ,I delete the home environment variable
And,It works.
If you have configured the home environment variable, try removing it and reconfiguring gitconfig