Tag Archives: Artificial intelligence (ai)

Learning notes of Python 3: debugger speedups using Python not found

When you first run the PY module (eclipse), you usually encounter warning

warning: Debugger speedups using cython not found. Run '"C:\Python\Python36\python.exe" "C:\D\J2EESpace\eclipseNEON2\plugins\org.python.pydev.core_6.3.3.201805051638\pysrc\setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 10056)

The warning will not affect the running of the program. Indicates that cython was not found.

Python is an extension module tool of python, which is mixed with Python and C language to speed up the efficiency of Python.

According to the prompt, enter the “pysrc” directory and execute

python setup_cython.py build_ext --inplace

That’s it.

Note that “Microsoft Visual C + + 14.0 is required” error sometimes occurs during execution.

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

Therefore, it is necessary to ensure that Microsoft Visual C + + 14.0 (download address) is installed on the PC.

AttributeError: module ‘cv2.cv2‘ has no attribute ‘face‘

Today, there was an error when running opencv module attributeerror: module 'CV2. CV2' has no attribute 'face' , CSDN checked and said that it was necessary to uninstall opencv first and then install it again. I felt that it was too troublesome, so I tried to find the answer in stackoverflow, which was effective. I specially recorded it

Opencv has two modules, OpenCV_ contrib_ pythonopencv_ Python let their two version numbers be the same is OK.
If not, adjust the version number of the two modules at the same time and try again. Remember to be consistent

PIP install the specified version

pip install opencv_contrib_python == version

If this helps you, please click like to support it 😀

Runtimeerror using Python training model: CUDA out of memory error resolution

RuntimeError: CUDA out of memory occurs using the PyTorch training model
Training: Due to the limited GPU video memory resources, the batchsize of training input should not be too large, which will lead to Out of Memory errors.
Solution: Reduce the batchSize to even 1
Use with torch.no_grad():fore testing the code

Solution: when cmake is compiled, “error in configuration process project files may be invalid” appears

This error can occur with either CMake2.84 or with the current update CMake2.87:
 
Searching the domestic and foreign Internet did not give a feasible way, the result or their own solution
Now the error causes and solutions are as follows:
what went wrong: because is English version, usually didn’t read the installation instructions, according to the default installation and “next” to the next step, the result is to choose what you use in the installation of programming system, such as: Vs2008, vs2010 etc., if a default value for the current installation is not with your current version and do not pay attention to in the use of some details will go wrong, and the output directory already exists in the current setting of error is
solution: The first option is to uninstall and reinstall Cmake, and remember to select the language type when reinstalling it. The second option is to randomly select the correct directory containing cmakelists.txt in the source project box. In the output directory text box, fill in a directory that does not exist, then click Configuer, you will be prompted to create a directory, click “Yes”, a language selection window will pop up, drop down select the language type you are using, that is, you are currently using VS2010 installed;
it can be right for the next step, if again open CMake – GUI. Exe, will be the default language of your choice, won’t go wrong
root cause analysis: when languages die erste installation didn’t choose good, in the running for the first time, the output directory does not pop up when there are language selection window and direct judgment and output of the error message;
Suggestion: The authorities can publish a pop-up language selection window regardless of whether the current output directory exists
 
My installation environment is VS2013+opencv3.0+cmake3.4, but tried a variety of methods on the Internet or not, finally solved the problem through the following:
Download such a file, http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv/, select download ippicv_windows_20141027. Zip
 
3. When CMAKE2.8.12 +PCL1.6+VS2010 is configured under Windows 7 32-bit system, it appears
CMake error: error in configuration process, project files may be invalid

Parse error. Expected a command name, got unquoted argument with text
Solution: Update the version to cmake3.7.

Reproduced in: https://www.cnblogs.com/haoyul/p/4979309.html

Install error after vs compilation (error msb3073)

The following error occurred in VS compilation:
Error MSB3073: command “setLocal
H:\PCL_BACKUP\PCL\CMake\bin\ cmake.exe-dbuild_type =Release -p cmake_install. Cmake
%errorlevel% neq 0 goto :cmEnd
:>nd
endLoca>amp; call :cmErrorLevel %errorlevel% & Goto :cmDone
exit /b %1
cmdone
i>errorlevel % neq 0 goto :VCEnd
: vcend> C: \ Program Files \ MSBuild \ Microsoft (x86) Cpp \ v4.0 \ V120 \ Microsoft CppCommon. The targets of 132 5 INSTALL
Solution:
Find the problematic project subitem
(install) project – & gt; Property – & gt; Generate events –>; Late generation event –>; Using –> in the build; no

Note:
When running vs

    , the install directory Settings in the disk C, did not start as an administrator will appear this kind of problem! CD :/openMVG/ install; CD :/openMVG/ install; CD :/eigen_3_4/eigen/installHere; CD :/eigen_3_4/eigen/installHere However, there is no installHere folder under D:/eigen_3_4/eigen/, so simply manually setting up the folder installHere can solve the problem.

Reproduced in: https://www.cnblogs.com/ZY-Dream/p/9955169.html

fix yahoo finance

Get the Yahoo data in Python

18:42:54, June 11, 2018

Reading count: 71

I learned machine learning in Python. I found a practical tutorial online. I needed to get stock data from Yahoo. The problems and solutions are given below.
Programming environment: Linux Ubuntu16, python3.6, anaconda 1.6.14, conda 4.5.4, pandas 0.23
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Problem 1: An environment interpretation error occurred while downloading Pandas _datareader
Because the Yahoo data needs to be retrieved through the Pandas _datareader module, you need to download and install the package
Environment parse error occurs with Conda Install Pandas _datareader (conda installation is used because anaconda is used to build the Python compile and edit environment) :

python@ubuntu:~$ conda install pandas_datareader
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - pandas_datareader

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/linux-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/linux-64
  - https://repo.anaconda.com/pkgs/pro/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Solution 1: Then change to PIP Install safari _datareader to install successfully!
Solution two: Later, I found that when I was using Conda to install the module, there were jupyter Notebook still running, so I tried to close it and then used Conda install Rebuild _datareader to find it could be successfully installed.
 
Question 2: ImportError: Cannot import name ‘is_list_like’ when using import pandas_datareader as PDR
I found many methods on the Internet, including the case column on StackFlow, but I still couldn’t find one suitable for me.
Solution one: Then give up searching for a solution online and start groping instead. Because the error message is that the module named ‘is_list_like’ cannot be imported, the code to find the error is in the first line from pandas.core.common.data import is_list_like in the fred.py module. Because the common folder and the modules under that folder cannot be found in the environment, the path to import is_list_like is wrong.
Then, Baidu search: panda IS_list_like finds the official API document of Pandas, and click Source to enter the source code module. It turns out that IS_list_like exists as a method of in the following path

Finally, I get rid of the Fred. Py the first line of the import path into: from pandas. Core. Dtype. Inference import is_list_like, import pandas_datareader modules again success!
 
Question 3: run the following code, appear ImmediateDeprecationError, namely the Yahoo! Finance no longer exists because in 2017 Yahoo! It was bought by Verizon

Yahoo Daily has been immediately deprecated due to large breaks in the API without the  
introduction of a stable replacement

The code is as follows:

     

    import pandas as pd

     

    import datetime

     

    import pandas_datareader.data as web

     

    start = datetime.datetime(
    2010,1,1)

     

    end = datetime.datetime(
    2017,1,1)

     

    df = web.get_data_yahoo(
    ‘SPY’,’yahoo’,start, end)

Baidu has found one solution in the CSDN blog: install Fix_yahoo_finance (PIP Install) and then run the following code before retrieving the data.

     

    import fix_yahoo_finance as fy

     

    fy.pdr_override()

Reproduced in: https://www.cnblogs.com/ziheIT/p/9249676.html

CNN and other websites encounter error 503

According to foreign media reports, CNN (CNN) and other well-known websites recently encountered Error 503. According to users, the affected sites include Reddit, The New York Times, CNN, BuzzFeed and other well-known websites, whose network management systems are experiencing major problems.
▲CNN and other well-known websites have encountered Error 503
The user says Error 503: Maximum Threads for service reached will be displayed on the screen.
Fastly, a company that provides cloud services for these sites, said the situation was a “global event” and multiple teams were working to fix and investigate.
Some analysts believe that the accident may be the result of a DDoS (distributed denial of service) attack. Error 503 occurs because the server is overloaded and cannot process new requests.
In addition, a new ransomware virus is sweeping the world, infiltrating many large multinational companies. Companies affected include WPP, Rosneft, Maersk, Merck, the US pharmaceutical company, Evraz, Russia’s second-largest steel company, and DLA Piper, among others. Ukraine has been hit extensively, affecting the state-owned power company Ukrenergo as well as several of the country’s Banks.
The WannaCry virus, which hit more than 200,000 Windows computers in more than 100 countries over a weekend in May, has affected organizations around the world, including French carmakers, Russian Banks and Telefonica operators, and captured the world’s attention. Vital information on Internet users’ computers has been encrypted by a virus that hackers say can only be recovered if a ransom is paid.
Jiangsu Sanai Network Technology Co. LTD
 

Reproduced in: https://my.oschina.net/u/3351259/blog/1116273