GithubHelp home page GithubHelp logo

Comments (2)

300LiterPropofol avatar 300LiterPropofol commented on June 3, 2024

TypeError: pad() missing 1 required positional argument: 'mode' seems to be a persisting issue across different examples, the same environment cannot run the anomaly_detection.py example in /example folder either,

C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\dataset\jsonl.py:74: FutureWarning: Conversion of the second argument of issubdtype from `int` to `np.signedinteger` is deprecated. In future, it will be treated as `np.int32 == np.dtype(int).type`.
  if np.issubdtype(arg.dtype, int):
  0%|                                                                                          | 0/100 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "anomaly_detection.py", line 48, in <module>
    train_output = estimator.train_model(dataset.train)
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\mx\model\estimator.py", line 219, in train_model
    validation_iter=validation_data_loader,
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\mx\trainer\_base.py", line 423, in __call__
    num_batches_to_use=self.num_batches_per_epoch,
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\mx\trainer\_base.py", line 275, in loop
    for batch_no, batch in enumerate(it, start=1):
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\tqdm\std.py", line 1182, in __iter__
    for obj in iterable:
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\itertools.py", line 420, in __iter__
    yield from itertools.islice(self.iterable, self.length)
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 112, in __iter__
    self.base_dataset, is_train=self.is_train
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 132, in __call__
    for data_entry in data_it:
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\dataset\loader.py", line 50, in __call__
    yield from batcher(data, self.batch_size)
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\itertools.py", line 131, in get_batch
    return list(itertools.islice(it, batch_size))
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 132, in __call__
    for data_entry in data_it:
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\_base.py", line 188, in __call__
    for result in self.flatmap_transform(data_entry.copy(), is_train):
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\split.py", line 161, in flatmap_transform
    yield self._split_instance(entry, idx)
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\split.py", line 134, in _split_instance
    past_piece, future_piece = self._split_array(entry[ts_field], idx)
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\transform\split.py", line 118, in _split_array
    value=self.dummy_value,
  File "C:\ProgramData\anaconda3\envs\mxnet_pure\lib\site-packages\gluonts\zebras\_util.py", line 50, in pad_axis
    return np.pad(a, pad_width, constant_values=value)
TypeError: pad() missing 1 required positional argument: 'mode'

from gluonts.

300LiterPropofol avatar 300LiterPropofol commented on June 3, 2024

Anaconda seems to not work, I managed to bypass this by using docker.
This is my requirements.txt

numpy==1.23.5
matplotlib==3.8.2
gluonts==0.14.3
mxnet==1.6.0
orjson==3.9.7

my Dockerfile

# Use an official Python runtime as a parent image
FROM python:3.9.18-bullseye

# Update and install required dependencies
RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y bash libstdc++6 libgomp1 build-essential

# Install Fortran compiler
RUN apt-get install -y gfortran

# Install musl
RUN apt-get install -y musl

# Set the working directory to /app
WORKDIR /app

# Install any needed packages specified in requirements.txt
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the current directory contents into the container at /app
COPY . .

# Make port 3000 available to the world outside this container
EXPOSE 3000

# Run app.py when the container launches
CMD ["python3", "app.py"]

my docker-compose.yml

version: '3'
services:
  app:
    container_name: app
    build:
      context: .
    ports:
      - "3000:3000"
    command: [ "python3", "app.py" ]
    networks:
      - data-stack
    volumes:
      - .:/app/

networks:
  # External network
  data-stack:
    external: true

since docker does not go well with interactive GUI plotting, I also changed all plt.show() into

# Save the figure to a file
plt.savefig("plot2.png")
plt.close()

Now I can run the example!

For anyone who has same issue, try the exact version above in docker

from gluonts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.